Update to 20210604 upstream source
Signed-off-by: Al Stone <ahs3@redhat.com>
This commit is contained in:
parent
1f5bfe9b39
commit
416465f9d4
@ -1,7 +1,7 @@
|
||||
From bb45113bc9aed952a499cd1c53988dc81f597582 Mon Sep 17 00:00:00 2001
|
||||
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/40] Add in basic infrastructure for big-endian support
|
||||
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
|
||||
@ -10,7 +10,9 @@ 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.
|
||||
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
|
||||
@ -24,16 +26,19 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
generate/unix/acpiexec/Makefile | 1 +
|
||||
generate/unix/acpihelp/Makefile | 1 +
|
||||
generate/unix/iasl/Makefile | 1 +
|
||||
source/components/utilities/utendian.c | 205 +++++++++++++++++++++++++
|
||||
source/include/acutils.h | 26 ++++
|
||||
source/include/platform/aclinux.h | 5 +
|
||||
9 files changed, 242 insertions(+)
|
||||
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-20200925/generate/unix/acpibin/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/acpibin/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/acpibin/Makefile
|
||||
+++ acpica-unix2-20200925/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\
|
||||
@ -42,10 +47,10 @@ Index: acpica-unix2-20200925/generate/unix/acpibin/Makefile
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/utlock.o\
|
||||
Index: acpica-unix2-20200925/generate/unix/acpidump/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/acpidump/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/acpidump/Makefile
|
||||
+++ acpica-unix2-20200925/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\
|
||||
@ -54,10 +59,10 @@ Index: acpica-unix2-20200925/generate/unix/acpidump/Makefile
|
||||
$(OBJDIR)/tbprint.o\
|
||||
$(OBJDIR)/tbxfroot.o\
|
||||
$(OBJDIR)/utascii.o\
|
||||
Index: acpica-unix2-20200925/generate/unix/acpiexamples/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/acpiexamples/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/acpiexamples/Makefile
|
||||
+++ acpica-unix2-20200925/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\
|
||||
@ -66,10 +71,10 @@ Index: acpica-unix2-20200925/generate/unix/acpiexamples/Makefile
|
||||
$(OBJDIR)/uterror.o\
|
||||
$(OBJDIR)/uteval.o\
|
||||
$(OBJDIR)/utexcep.o\
|
||||
Index: acpica-unix2-20200925/generate/unix/acpiexec/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/acpiexec/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/acpiexec/Makefile
|
||||
+++ acpica-unix2-20200925/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\
|
||||
@ -78,11 +83,11 @@ Index: acpica-unix2-20200925/generate/unix/acpiexec/Makefile
|
||||
$(OBJDIR)/uterror.o\
|
||||
$(OBJDIR)/uteval.o\
|
||||
$(OBJDIR)/utexcep.o\
|
||||
Index: acpica-unix2-20200925/generate/unix/acpihelp/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/acpihelp/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/acpihelp/Makefile
|
||||
+++ acpica-unix2-20200925/generate/unix/acpihelp/Makefile
|
||||
@@ -43,6 +43,7 @@ OBJECTS = \
|
||||
--- 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\
|
||||
@ -90,10 +95,10 @@ Index: acpica-unix2-20200925/generate/unix/acpihelp/Makefile
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
Index: acpica-unix2-20200925/generate/unix/iasl/Makefile
|
||||
Index: acpica-unix2-20210604/generate/unix/iasl/Makefile
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/generate/unix/iasl/Makefile
|
||||
+++ acpica-unix2-20200925/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\
|
||||
@ -102,11 +107,64 @@ Index: acpica-unix2-20200925/generate/unix/iasl/Makefile
|
||||
$(OBJDIR)/uterror.o\
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
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-20200925/source/components/utilities/utendian.c
|
||||
@@ -0,0 +1,205 @@
|
||||
+++ acpica-unix2-20210604/source/components/utilities/utendian.c
|
||||
@@ -0,0 +1,236 @@
|
||||
+/******************************************************************************
|
||||
+ *
|
||||
+ * Module Name: utendian -- byte swapping support for other-endianness
|
||||
@ -156,7 +214,6 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+#define _COMPONENT ACPI_COMPILER
|
||||
+ ACPI_MODULE_NAME ("utendian")
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * Endianness support functions.
|
||||
+ *
|
||||
@ -167,6 +224,32 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * 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 */
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
@ -182,21 +265,24 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+#if defined(ACPI_BIG_ENDIAN)
|
||||
+UINT16 AcpiUtReadUint16 (void *SrcPtr)
|
||||
+UINT16
|
||||
+AcpiUtReadUint16 (
|
||||
+ void *SrcPtr)
|
||||
+{
|
||||
+ UINT16 Result = 0;
|
||||
+ UINT8 *Dst = (UINT8 *)&Result;
|
||||
+ UINT8 *Src = (UINT8 *)SrcPtr;
|
||||
+ UINT8 *Dst = (UINT8 *) &Result;
|
||||
+ UINT8 *Src = (UINT8 *) SrcPtr;
|
||||
+
|
||||
+ if (!UtIsBigEndianMachine())
|
||||
+ {
|
||||
+ return (*(UINT16 *) SrcPtr);
|
||||
+ }
|
||||
+
|
||||
+ Dst[0] = Src[1];
|
||||
+ Dst[1] = Src[0];
|
||||
+
|
||||
+ return Result;
|
||||
+ return (Result);
|
||||
+}
|
||||
+#else
|
||||
+UINT16 AcpiUtReadUint16 (void *SrcPtr) { return *(UINT16 *)SrcPtr; }
|
||||
+#endif
|
||||
+
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
@ -212,23 +298,26 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+#if defined(ACPI_BIG_ENDIAN)
|
||||
+UINT32 AcpiUtReadUint32 (void *SrcPtr)
|
||||
+UINT32
|
||||
+AcpiUtReadUint32 (
|
||||
+ void *SrcPtr)
|
||||
+{
|
||||
+ UINT32 Result = 0;
|
||||
+ UINT8 *Dst = (UINT8 *)&Result;
|
||||
+ UINT8 *Src = (UINT8 *)SrcPtr;
|
||||
+ 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;
|
||||
+ return (Result);
|
||||
+}
|
||||
+#else
|
||||
+UINT32 AcpiUtReadUint32 (void *SrcPtr) { return *(UINT32 *)SrcPtr; }
|
||||
+#endif
|
||||
+
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
@ -244,12 +333,18 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+#if defined(ACPI_BIG_ENDIAN)
|
||||
+UINT64 AcpiUtReadUint64 (void *SrcPtr)
|
||||
+UINT64
|
||||
+AcpiUtReadUint64 (
|
||||
+ void *SrcPtr)
|
||||
+{
|
||||
+ UINT64 Result = 0;
|
||||
+ UINT8 *Dst = (UINT8 *)&Result;
|
||||
+ UINT8 *Src = (UINT8 *)SrcPtr;
|
||||
+ UINT8 *Dst = (UINT8 *) &Result;
|
||||
+ UINT8 *Src = (UINT8 *) SrcPtr;
|
||||
+
|
||||
+ if (!UtIsBigEndianMachine())
|
||||
+ {
|
||||
+ return (*(UINT64 *) SrcPtr);
|
||||
+ }
|
||||
+
|
||||
+ Dst[0] = Src[7];
|
||||
+ Dst[1] = Src[6];
|
||||
@ -260,11 +355,8 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ Dst[6] = Src[1];
|
||||
+ Dst[7] = Src[0];
|
||||
+
|
||||
+ return Result;
|
||||
+ return (Result);
|
||||
+}
|
||||
+#else
|
||||
+UINT64 AcpiUtReadUint64 (void *SrcPtr) { return *(UINT64 *)SrcPtr; }
|
||||
+#endif
|
||||
+
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
@ -285,44 +377,121 @@ Index: acpica-unix2-20200925/source/components/utilities/utendian.c
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+#if defined(ACPI_BIG_ENDIAN)
|
||||
+void AcpiUtWriteUint (void *DstPtr, int DstLength,
|
||||
+ const void *SrcPtr, const int SrcLength)
|
||||
+void
|
||||
+AcpiUtWriteUint (
|
||||
+ void *DstPtr,
|
||||
+ int DstLength,
|
||||
+ const void *SrcPtr,
|
||||
+ const int SrcLength)
|
||||
+{
|
||||
+ UINT8 *Dst = (UINT8 *)DstPtr;
|
||||
+ UINT8 *Src = (UINT8 *)SrcPtr;
|
||||
+ 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];
|
||||
+
|
||||
+}
|
||||
+#else
|
||||
+void AcpiUtWriteUint (void *DstPtr, int DstLength,
|
||||
+ const void *SrcPtr, const int SrcLength)
|
||||
+{
|
||||
+ UINT8 *Dst = (UINT8 *)DstPtr;
|
||||
+ UINT8 *Src = (UINT8 *)SrcPtr;
|
||||
+ uint Length;
|
||||
+
|
||||
+ Length = SrcLength > DstLength ? DstLength : SrcLength;
|
||||
+ memcpy(Dst, Src, Length);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
Index: acpica-unix2-20200925/source/include/acutils.h
|
||||
Index: acpica-unix2-20210604/source/include/acmacros.h
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/include/acutils.h
|
||||
+++ acpica-unix2-20200925/source/include/acutils.h
|
||||
@@ -1161,4 +1161,30 @@ AcpiUtConvertStringToUuid (
|
||||
UINT8 *UuidBuffer);
|
||||
--- 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)
|
||||
@ -347,10 +516,10 @@ Index: acpica-unix2-20200925/source/include/acutils.h
|
||||
+#endif
|
||||
+
|
||||
#endif /* _ACUTILS_H */
|
||||
Index: acpica-unix2-20200925/source/include/platform/aclinux.h
|
||||
Index: acpica-unix2-20210604/source/include/platform/aclinux.h
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/include/platform/aclinux.h
|
||||
+++ acpica-unix2-20200925/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
|
||||
@ -359,14 +528,3 @@ Index: acpica-unix2-20200925/source/include/platform/aclinux.h
|
||||
#endif
|
||||
|
||||
/* Define/disable kernel-specific declarators */
|
||||
@@ -233,6 +234,10 @@
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
+#define ACPI_BIG_ENDIAN
|
||||
+#endif
|
||||
+
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ACLINUX_H__ */
|
||||
|
@ -1,7 +1,7 @@
|
||||
From d0c879747147c24c47bae363359127d62cd0cae1 Mon Sep 17 00:00:00 2001
|
||||
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/40] Modify utility functions to be endian-agnostic
|
||||
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
|
||||
@ -24,10 +24,10 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/components/tables/tbprint.c | 13 +++++++++----
|
||||
5 files changed, 26 insertions(+), 17 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/acfileio.c
|
||||
Index: acpica-unix2-20210604/source/common/acfileio.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/acfileio.c
|
||||
+++ acpica-unix2-20200925/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;
|
||||
@ -41,7 +41,7 @@ Index: acpica-unix2-20200925/source/common/acfileio.c
|
||||
/* Allocate a buffer for the entire table */
|
||||
|
||||
- Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
|
||||
+ Length = AcpiUtReadUint32(&TableHeader.Length);
|
||||
+ Length = AcpiUtReadUint32 (&TableHeader.Length);
|
||||
+ Table = AcpiOsAllocate ((ACPI_SIZE) Length);
|
||||
if (!Table)
|
||||
{
|
||||
@ -79,12 +79,12 @@ Index: acpica-unix2-20200925/source/common/acfileio.c
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcValidateTableHeader);
|
||||
@@ -464,11 +467,12 @@ 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);
|
||||
+ Length = AcpiUtReadUint32 (&TableHeader.Length);
|
||||
+ if (Length > (UINT32) (FileSize - TableOffset))
|
||||
{
|
||||
fprintf (stderr, "Table [%4.4s] is too long for file - "
|
||||
@ -94,29 +94,29 @@ Index: acpica-unix2-20200925/source/common/acfileio.c
|
||||
(UINT32) (FileSize - TableOffset));
|
||||
return (AE_BAD_HEADER);
|
||||
}
|
||||
Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtable.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtable.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtable.c
|
||||
@@ -534,7 +534,7 @@ AcpiDmDumpDataTable (
|
||||
--- 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);
|
||||
+ Length = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
|
||||
ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
|
||||
@@ -551,7 +551,7 @@ AcpiDmDumpDataTable (
|
||||
@@ -608,7 +608,7 @@ AcpiDmDumpDataTable (
|
||||
*/
|
||||
if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
|
||||
{
|
||||
- Length = Table->Length;
|
||||
+ Length = AcpiUtReadUint32(&Table->Length);
|
||||
+ Length = AcpiUtReadUint32 (&Table->Length);
|
||||
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -571,7 +571,7 @@ AcpiDmDumpDataTable (
|
||||
@@ -628,7 +628,7 @@ AcpiDmDumpDataTable (
|
||||
/*
|
||||
* All other tables must use the common ACPI table header, dump it now
|
||||
*/
|
||||
@ -125,45 +125,45 @@ Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1179,7 +1179,7 @@ AcpiDmDumpTable (
|
||||
@@ -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)),
|
||||
+ 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-20200925/source/compiler/dtfield.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dtfield.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dtfield.c
|
||||
+++ acpica-unix2-20200925/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));
|
||||
+ AcpiUtWriteUint (Buffer, ByteLength, &Value, sizeof (UINT64));
|
||||
return;
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dtsubtable.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dtsubtable.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dtsubtable.c
|
||||
+++ acpica-unix2-20200925/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));
|
||||
+ AcpiUtWriteUint (Subtable->LengthField, Subtable->SizeOfLengthField,
|
||||
+ &Subtable->TotalLength, sizeof (Subtable->TotalLength));
|
||||
}
|
||||
Index: acpica-unix2-20200925/source/components/tables/tbprint.c
|
||||
Index: acpica-unix2-20210604/source/components/tables/tbprint.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/components/tables/tbprint.c
|
||||
+++ acpica-unix2-20200925/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"
|
||||
@ -178,7 +178,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbprint.c
|
||||
ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
|
||||
Header->Signature, ACPI_FORMAT_UINT64 (Address),
|
||||
- Header->Length));
|
||||
+ AcpiUtReadUint32(&Header->Length)));
|
||||
+ AcpiUtReadUint32 (&Header->Length)));
|
||||
}
|
||||
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
|
||||
{
|
||||
@ -189,12 +189,12 @@ Index: acpica-unix2-20200925/source/components/tables/tbprint.c
|
||||
- LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
|
||||
- LocalHeader.OemTableId, LocalHeader.OemRevision,
|
||||
- LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
|
||||
+ AcpiUtReadUint32(&LocalHeader.Length),
|
||||
+ AcpiUtReadUint32 (&LocalHeader.Length),
|
||||
+ LocalHeader.Revision, LocalHeader.OemId,
|
||||
+ LocalHeader.OemTableId,
|
||||
+ AcpiUtReadUint32(&LocalHeader.OemRevision),
|
||||
+ AcpiUtReadUint32 (&LocalHeader.OemRevision),
|
||||
+ LocalHeader.AslCompilerId,
|
||||
+ AcpiUtReadUint32(&LocalHeader.AslCompilerRevision)));
|
||||
+ AcpiUtReadUint32 (&LocalHeader.AslCompilerRevision)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 08862d9a4be8262c045549c287adf1e6c320cbec Mon Sep 17 00:00:00 2001
|
||||
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/40] Always display table header content in human-readable
|
||||
Subject: [PATCH 03/45] Always display table header content in human-readable
|
||||
form
|
||||
|
||||
When comparing two binary data tables, little-endian values are read
|
||||
@ -10,13 +10,13 @@ form that makes sense to humans.
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/tools/acpibin/abcompare.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
source/tools/acpibin/abcompare.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/tools/acpibin/abcompare.c
|
||||
Index: acpica-unix2-20210604/source/tools/acpibin/abcompare.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/tools/acpibin/abcompare.c
|
||||
+++ acpica-unix2-20200925/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 @@
|
||||
*/
|
||||
|
||||
@ -25,27 +25,21 @@ Index: acpica-unix2-20200925/source/tools/acpibin/abcompare.c
|
||||
|
||||
|
||||
ACPI_TABLE_HEADER Header1;
|
||||
@@ -179,14 +180,20 @@ AbPrintHeadersInfo (
|
||||
@@ -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 ("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 ("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 ("Compiler Revision %8.8X : %8.8X\n", AcpiUtReadUint32 (&Header->AslCompilerRevision), AcpiUtReadUint32 (&Header2->AslCompilerRevision));
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 16c399a7e2a2c7bd8fb8f38fed202f23c3a786a9 Mon Sep 17 00:00:00 2001
|
||||
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/40] Re-enable support for big-endian machines
|
||||
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
|
||||
@ -13,10 +13,10 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/components/namespace/nsutils.c | 7 +++++--
|
||||
2 files changed, 5 insertions(+), 14 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/aslmain.c
|
||||
Index: acpica-unix2-20210604/source/compiler/aslmain.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/aslmain.c
|
||||
+++ acpica-unix2-20200925/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);
|
||||
@ -36,10 +36,10 @@ Index: acpica-unix2-20200925/source/compiler/aslmain.c
|
||||
AcpiOsInitialize ();
|
||||
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
|
||||
|
||||
Index: acpica-unix2-20200925/source/components/namespace/nsutils.c
|
||||
Index: acpica-unix2-20210604/source/components/namespace/nsutils.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/components/namespace/nsutils.c
|
||||
+++ acpica-unix2-20200925/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;
|
||||
@ -52,7 +52,7 @@ Index: acpica-unix2-20200925/source/components/namespace/nsutils.c
|
||||
|
||||
for (; NumSegments; NumSegments--)
|
||||
{
|
||||
+ memset(TmpSeg, 0, ACPI_NAMESEG_SIZE+1);
|
||||
+ memset (TmpSeg, 0, ACPI_NAMESEG_SIZE+1);
|
||||
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
|
||||
{
|
||||
if (ACPI_IS_PATH_SEPARATOR (*ExternalName) ||
|
||||
@ -72,7 +72,7 @@ Index: acpica-unix2-20200925/source/components/namespace/nsutils.c
|
||||
ExternalName++;
|
||||
}
|
||||
}
|
||||
+ AcpiUtWriteUint(Result, ACPI_NAMESEG_SIZE, TmpSeg, ACPI_NAMESEG_SIZE);
|
||||
+ AcpiUtWriteUint (Result, ACPI_NAMESEG_SIZE, TmpSeg, ACPI_NAMESEG_SIZE);
|
||||
|
||||
/* Now we must have a path separator, or the pathname is bad */
|
||||
|
||||
|
@ -1,22 +1,23 @@
|
||||
From 9dc82e99776b18fe19314695d7d83e79c7fea934 Mon Sep 17 00:00:00 2001
|
||||
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] Correct an endian-ness problem when converting ASL to ASL+
|
||||
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(-)
|
||||
|
||||
diff --git a/source/compiler/cvparser.c b/source/compiler/cvparser.c
|
||||
index 370b80361..7311e031a 100644
|
||||
--- a/source/compiler/cvparser.c
|
||||
+++ b/source/compiler/cvparser.c
|
||||
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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
if (!AcpiGbl_CaptureComments)
|
||||
@ -38,6 +39,3 @@ index 370b80361..7311e031a 100644
|
||||
AcpiGbl_FileTreeRoot->Next = NULL;
|
||||
AcpiGbl_FileTreeRoot->Parent = NULL;
|
||||
AcpiGbl_FileTreeRoot->Filename = (char *)(AmlStart+2);
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,32 @@
|
||||
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") */
|
||||
|
53
0007-Handle-dumping-Unicode-properly-when-big-endian.patch
Normal file
53
0007-Handle-dumping-Unicode-properly-when-big-endian.patch
Normal file
@ -0,0 +1,53 @@
|
||||
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");
|
@ -1,27 +1,27 @@
|
||||
From f11fb1c691174eb7d236d60ad48da19e56291fef Mon Sep 17 00:00:00 2001
|
||||
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 05/40] Support MADT (aka APIC) in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -607,7 +607,7 @@ AcpiDmDumpMadt (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_MADT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
|
||||
@@ -623,7 +623,7 @@ AcpiDmDumpMadt (
|
||||
@@ -779,7 +779,7 @@ AcpiDmDumpMadt (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
|
@ -1,7 +1,7 @@
|
||||
From 5ac8e9cca71eacd4f18dba2eb89e9b65a805f712 Mon Sep 17 00:00:00 2001
|
||||
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 06/40] Support ASF! tables in a big-endian world
|
||||
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.
|
||||
|
||||
@ -10,10 +10,10 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/common/dmtbdump1.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/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;
|
||||
@ -25,7 +25,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
|
||||
- while (Offset < Table->Length)
|
||||
+ TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
+ TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
+ while (Offset < TableLength)
|
||||
{
|
||||
/* Common subtable header */
|
@ -1,27 +1,27 @@
|
||||
From d66af65b4cd0a2719e5a06b77f8eda5e892bfc63 Mon Sep 17 00:00:00 2001
|
||||
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 07/40] Support CPEP tables in a big-endian world
|
||||
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-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -243,7 +243,7 @@ AcpiDmDumpCpep (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_CPEP);
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ AcpiDmDumpCpep (
|
||||
@@ -334,7 +334,7 @@ AcpiDmDumpCpep (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
|
@ -1,28 +1,28 @@
|
||||
From 2d7396fe2b270b0bed6a6436f9e3d15cfbb9abfc Mon Sep 17 00:00:00 2001
|
||||
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 08/40] Support DBG2 table in a big-endian world
|
||||
Subject: [PATCH 11/45] Support DBG2 table in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump1.c | 35 +++++++++++++++++--------------
|
||||
source/common/dmtbdump1.c | 37 ++++++++++++++++++--------------
|
||||
source/compiler/dttable1.c | 43 ++++++++++++++++++++++++--------------
|
||||
2 files changed, 46 insertions(+), 32 deletions(-)
|
||||
2 files changed, 48 insertions(+), 32 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -298,7 +298,7 @@ AcpiDmDumpCsrt (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_CSRT);
|
||||
UINT32 SubOffset;
|
||||
UINT32 SubSubOffset;
|
||||
@@ -310,7 +310,7 @@ AcpiDmDumpCsrt (
|
||||
@@ -386,7 +386,7 @@ AcpiDmDumpCsrt (
|
||||
/* Subtables (Resource Groups) */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
|
||||
@ -31,7 +31,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
/* Resource group subtable */
|
||||
|
||||
@@ -344,7 +344,7 @@ AcpiDmDumpCsrt (
|
||||
@@ -420,7 +420,7 @@ AcpiDmDumpCsrt (
|
||||
Offset + SubOffset);
|
||||
|
||||
while ((SubOffset < Subtable->Length) &&
|
||||
@ -40,12 +40,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
|
||||
@@ -405,12 +405,13 @@ AcpiDmDumpDbg2 (
|
||||
@@ -481,12 +481,13 @@ AcpiDmDumpDbg2 (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_DBG2_DEVICE *Subtable;
|
||||
- UINT32 Length = Table->Length;
|
||||
+ UINT32 Length = AcpiUtReadUint32(&Table->Length);
|
||||
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_DBG2);
|
||||
UINT32 i;
|
||||
UINT32 ArrayOffset;
|
||||
@ -55,7 +55,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -424,11 +425,12 @@ AcpiDmDumpDbg2 (
|
||||
@@ -500,11 +501,12 @@ AcpiDmDumpDbg2 (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
|
||||
@ -63,19 +63,19 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
+ while (Offset < Length)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
+ SubtableLength = AcpiUtReadUint16(&Subtable->Length);
|
||||
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
|
||||
Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoDbg2Device);
|
||||
+ SubtableLength, AcpiDmTableInfoDbg2Device);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -438,13 +440,13 @@ AcpiDmDumpDbg2 (
|
||||
@@ -514,13 +516,13 @@ AcpiDmDumpDbg2 (
|
||||
|
||||
for (i = 0; i < Subtable->RegisterCount; i++)
|
||||
{
|
||||
- ArrayOffset = Subtable->BaseAddressOffset +
|
||||
+ ArrayOffset = AcpiUtReadUint16(&Subtable->BaseAddressOffset) +
|
||||
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->BaseAddressOffset) +
|
||||
(sizeof (ACPI_GENERIC_ADDRESS) * i);
|
||||
AbsoluteOffset = Offset + ArrayOffset;
|
||||
Array = (UINT8 *) Subtable + ArrayOffset;
|
||||
@ -86,12 +86,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -455,13 +457,13 @@ AcpiDmDumpDbg2 (
|
||||
@@ -531,13 +533,13 @@ AcpiDmDumpDbg2 (
|
||||
|
||||
for (i = 0; i < Subtable->RegisterCount; i++)
|
||||
{
|
||||
- ArrayOffset = Subtable->AddressSizeOffset +
|
||||
+ ArrayOffset = AcpiUtReadUint16(&Subtable->AddressSizeOffset) +
|
||||
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->AddressSizeOffset) +
|
||||
(sizeof (UINT32) * i);
|
||||
AbsoluteOffset = Offset + ArrayOffset;
|
||||
Array = (UINT8 *) Subtable + ArrayOffset;
|
||||
@ -102,12 +102,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -471,12 +473,12 @@ AcpiDmDumpDbg2 (
|
||||
@@ -547,12 +549,12 @@ AcpiDmDumpDbg2 (
|
||||
/* Dump the Namestring (required) */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- ArrayOffset = Subtable->NamepathOffset;
|
||||
+ ArrayOffset = AcpiUtReadUint16(&Subtable->NamepathOffset);
|
||||
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->NamepathOffset);
|
||||
AbsoluteOffset = Offset + ArrayOffset;
|
||||
Array = (UINT8 *) Subtable + ArrayOffset;
|
||||
|
||||
@ -117,19 +117,21 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -486,8 +488,9 @@ AcpiDmDumpDbg2 (
|
||||
@@ -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),
|
||||
+ Table, AcpiUtReadUint16(&Subtable->OemDataLength),
|
||||
+ Offset + AcpiUtReadUint16 (&Subtable->OemDataOffset),
|
||||
+ Array, AcpiUtReadUint16 (&Subtable->OemDataLength),
|
||||
AcpiDmTableInfoDbg2OemData);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -497,9 +500,9 @@ AcpiDmDumpDbg2 (
|
||||
@@ -573,9 +578,9 @@ AcpiDmDumpDbg2 (
|
||||
|
||||
/* Point to next subtable */
|
||||
|
||||
@ -141,11 +143,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
}
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -281,6 +281,7 @@ DtCompileCsrt (
|
||||
--- 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;
|
||||
@ -153,7 +155,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
|
||||
|
||||
/* Subtables (Resource Groups) */
|
||||
@@ -299,12 +300,13 @@ DtCompileCsrt (
|
||||
@@ -373,12 +374,13 @@ DtCompileCsrt (
|
||||
|
||||
/* Compute the number of resource descriptors */
|
||||
|
||||
@ -163,17 +165,17 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
- (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
|
||||
- Subtable->Buffer))->SharedInfoLength -
|
||||
- sizeof (ACPI_CSRT_GROUP);
|
||||
+ Tmp = AcpiUtReadUint32(&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
|
||||
+ Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
|
||||
+ Subtable->Buffer))->Length);
|
||||
+ GroupLength = Tmp;
|
||||
+ Tmp = AcpiUtReadUint32(&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
|
||||
+ Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
|
||||
+ Subtable->Buffer))->SharedInfoLength);
|
||||
+ GroupLength -= Tmp;
|
||||
+ GroupLength -= sizeof (ACPI_CSRT_GROUP);
|
||||
|
||||
DescriptorCount = (GroupLength /
|
||||
sizeof (ACPI_CSRT_DESCRIPTOR));
|
||||
@@ -392,6 +394,7 @@ DtCompileDbg2 (
|
||||
@@ -466,6 +468,7 @@ DtCompileDbg2 (
|
||||
ACPI_DBG2_DEVICE *DeviceInfo;
|
||||
UINT16 CurrentOffset;
|
||||
UINT32 i;
|
||||
@ -181,7 +183,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -408,10 +411,12 @@ DtCompileDbg2 (
|
||||
@@ -482,10 +485,12 @@ DtCompileDbg2 (
|
||||
/* Main table fields */
|
||||
|
||||
Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
|
||||
@ -189,66 +191,66 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
- 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));
|
||||
+ AcpiUtWriteUint (&Dbg2Header->InfoOffset, sizeof (UINT32),
|
||||
+ &Tmp, sizeof (UINT32));
|
||||
|
||||
- SubtableCount = Dbg2Header->InfoCount;
|
||||
+ SubtableCount = Tmp;
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
/* Process all Device Information subtables (Count = InfoCount) */
|
||||
@@ -438,7 +443,8 @@ DtCompileDbg2 (
|
||||
@@ -512,7 +517,8 @@ DtCompileDbg2 (
|
||||
|
||||
/* BaseAddressRegister GAS array (Required, size is RegisterCount) */
|
||||
|
||||
- DeviceInfo->BaseAddressOffset = CurrentOffset;
|
||||
+ AcpiUtWriteUint(&DeviceInfo->BaseAddressOffset, sizeof(UINT16),
|
||||
+ &CurrentOffset, sizeof(UINT16));
|
||||
+ AcpiUtWriteUint (&DeviceInfo->BaseAddressOffset, sizeof (UINT16),
|
||||
+ &CurrentOffset, sizeof (UINT16));
|
||||
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
|
||||
@@ -454,7 +460,8 @@ DtCompileDbg2 (
|
||||
@@ -528,7 +534,8 @@ DtCompileDbg2 (
|
||||
|
||||
/* AddressSize array (Required, size = RegisterCount) */
|
||||
|
||||
- DeviceInfo->AddressSizeOffset = CurrentOffset;
|
||||
+ AcpiUtWriteUint(&DeviceInfo->AddressSizeOffset, sizeof(UINT16),
|
||||
+ &CurrentOffset, sizeof(UINT16));
|
||||
+ AcpiUtWriteUint (&DeviceInfo->AddressSizeOffset, sizeof (UINT16),
|
||||
+ &CurrentOffset, sizeof (UINT16));
|
||||
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
|
||||
@@ -470,7 +477,8 @@ DtCompileDbg2 (
|
||||
@@ -544,7 +551,8 @@ DtCompileDbg2 (
|
||||
|
||||
/* NamespaceString device identifier (Required, size = NamePathLength) */
|
||||
|
||||
- DeviceInfo->NamepathOffset = CurrentOffset;
|
||||
+ AcpiUtWriteUint(&DeviceInfo->NamepathOffset, sizeof(UINT16),
|
||||
+ &CurrentOffset, sizeof(UINT16));
|
||||
+ AcpiUtWriteUint (&DeviceInfo->NamepathOffset, sizeof (UINT16),
|
||||
+ &CurrentOffset, sizeof (UINT16));
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
|
||||
&Subtable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -480,8 +488,9 @@ DtCompileDbg2 (
|
||||
@@ -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);
|
||||
+ AcpiUtWriteUint (&DeviceInfo->NamepathLength, sizeof (UINT16),
|
||||
+ &Subtable->Length, sizeof (UINT32));
|
||||
+ CurrentOffset += AcpiUtReadUint16 (&DeviceInfo->NamepathLength);
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
/* OemData - Variable-length data (Optional, size = OemDataLength) */
|
||||
@@ -508,8 +517,10 @@ DtCompileDbg2 (
|
||||
@@ -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));
|
||||
+ AcpiUtWriteUint (&DeviceInfo->OemDataOffset, sizeof (UINT16),
|
||||
+ &CurrentOffset, sizeof (UINT16));
|
||||
+ AcpiUtWriteUint (&DeviceInfo->OemDataLength, sizeof (UINT16),
|
||||
+ &Subtable->Length, sizeof (UINT32));
|
||||
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
From 01aad41e59efd615ac075fcedbaab0c60f9e1e11 Mon Sep 17 00:00:00 2001
|
||||
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 09/40] Support DMAR in a big-endian world
|
||||
Subject: [PATCH 12/45] Support DMAR in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -10,11 +10,11 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 12 +++++++-----
|
||||
3 files changed, 24 insertions(+), 18 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtable.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtable.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtable.c
|
||||
@@ -1244,13 +1244,13 @@ AcpiDmDumpTable (
|
||||
--- acpica-unix2-20210604.orig/source/common/dmtable.c
|
||||
+++ acpica-unix2-20210604/source/common/dmtable.c
|
||||
@@ -1341,13 +1341,13 @@ AcpiDmDumpTable (
|
||||
|
||||
/* DMAR subtable types */
|
||||
|
||||
@ -30,16 +30,16 @@ Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
AcpiDmDmarSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -526,13 +526,15 @@ AcpiDmDumpDmar (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
|
||||
@ -51,7 +51,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -546,13 +548,14 @@ AcpiDmDumpDmar (
|
||||
@@ -624,13 +626,14 @@ AcpiDmDumpDmar (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
|
||||
@ -61,24 +61,24 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
+ SubtableLength = AcpiUtReadUint16(&Subtable->Length);
|
||||
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
|
||||
Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoDmarHdr);
|
||||
+ SubtableLength, AcpiDmTableInfoDmarHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -560,7 +563,8 @@ AcpiDmDumpDmar (
|
||||
@@ -638,7 +641,8 @@ AcpiDmDumpDmar (
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
- switch (Subtable->Type)
|
||||
+ SubtableType = AcpiUtReadUint16(&Subtable->Type);
|
||||
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
|
||||
+ switch (SubtableType)
|
||||
{
|
||||
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
|
||||
|
||||
@@ -595,12 +599,12 @@ AcpiDmDumpDmar (
|
||||
@@ -673,12 +677,12 @@ AcpiDmDumpDmar (
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
|
||||
@ -93,7 +93,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -609,8 +613,8 @@ AcpiDmDumpDmar (
|
||||
@@ -687,8 +691,8 @@ AcpiDmDumpDmar (
|
||||
/*
|
||||
* Dump the optional device scope entries
|
||||
*/
|
||||
@ -104,7 +104,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
/* These types do not support device scopes */
|
||||
|
||||
@@ -618,7 +622,7 @@ AcpiDmDumpDmar (
|
||||
@@ -696,7 +700,7 @@ AcpiDmDumpDmar (
|
||||
}
|
||||
|
||||
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
|
||||
@ -113,7 +113,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
|
||||
@@ -659,9 +663,9 @@ AcpiDmDumpDmar (
|
||||
@@ -737,9 +741,9 @@ AcpiDmDumpDmar (
|
||||
NextSubtable:
|
||||
/* Point to next subtable */
|
||||
|
||||
@ -125,11 +125,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
}
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -560,6 +560,7 @@ DtCompileDmar (
|
||||
--- 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;
|
||||
@ -137,17 +137,17 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable);
|
||||
@@ -590,7 +591,8 @@ DtCompileDmar (
|
||||
@@ -664,7 +665,8 @@ DtCompileDmar (
|
||||
|
||||
DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
|
||||
|
||||
- switch (DmarHeader->Type)
|
||||
+ DmarHeaderType = AcpiUtReadUint16(&DmarHeader->Type);
|
||||
+ DmarHeaderType = AcpiUtReadUint16 (&DmarHeader->Type);
|
||||
+ switch (DmarHeaderType)
|
||||
{
|
||||
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
|
||||
|
||||
@@ -637,8 +639,8 @@ DtCompileDmar (
|
||||
@@ -711,8 +713,8 @@ DtCompileDmar (
|
||||
/*
|
||||
* Optional Device Scope subtables
|
||||
*/
|
||||
@ -158,13 +158,13 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
{
|
||||
/* These types do not support device scopes */
|
||||
|
||||
@@ -647,8 +649,8 @@ DtCompileDmar (
|
||||
@@ -721,8 +723,8 @@ DtCompileDmar (
|
||||
}
|
||||
|
||||
DtPushSubtable (Subtable);
|
||||
- DeviceScopeLength = DmarHeader->Length - Subtable->Length -
|
||||
- ParentTable->Length;
|
||||
+ DeviceScopeLength = AcpiUtReadUint16(&DmarHeader->Length) -
|
||||
+ DeviceScopeLength = AcpiUtReadUint16 (&DmarHeader->Length) -
|
||||
+ Subtable->Length - ParentTable->Length;
|
||||
while (DeviceScopeLength)
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
From 9583e760908d4b7d2dabec82137d16f2492d2773 Mon Sep 17 00:00:00 2001
|
||||
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 10/40] Support DRTM in a big-endian world
|
||||
Subject: [PATCH 13/45] Support DRTM in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,17 +9,17 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 6 ++++--
|
||||
2 files changed, 19 insertions(+), 12 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -692,11 +692,14 @@ AcpiDmDumpDrtm (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -29,7 +29,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
AcpiDmTableInfoDrtm);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -711,7 +714,7 @@ AcpiDmDumpDrtm (
|
||||
@@ -789,7 +792,7 @@ AcpiDmDumpDrtm (
|
||||
|
||||
DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -38,13 +38,13 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
|
||||
AcpiDmTableInfoDrtm0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -724,10 +727,11 @@ AcpiDmDumpDrtm (
|
||||
@@ -802,10 +805,11 @@ AcpiDmDumpDrtm (
|
||||
/* Dump Validated table addresses */
|
||||
|
||||
Count = 0;
|
||||
- while ((Offset < Table->Length) &&
|
||||
- (DrtmVtl->ValidatedTableCount > Count))
|
||||
+ ValidatedTableCount = AcpiUtReadUint32(&DrtmVtl->ValidatedTableCount);
|
||||
+ ValidatedTableCount = AcpiUtReadUint32 (&DrtmVtl->ValidatedTableCount);
|
||||
+ while ((Offset < TableLength) &&
|
||||
+ (ValidatedTableCount > Count))
|
||||
{
|
||||
@ -53,7 +53,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
|
||||
AcpiDmTableInfoDrtm0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -743,7 +747,7 @@ AcpiDmDumpDrtm (
|
||||
@@ -821,7 +825,7 @@ AcpiDmDumpDrtm (
|
||||
|
||||
DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -62,13 +62,13 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
|
||||
AcpiDmTableInfoDrtm1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -756,10 +760,11 @@ AcpiDmDumpDrtm (
|
||||
@@ -834,10 +838,11 @@ AcpiDmDumpDrtm (
|
||||
/* Dump the Resource List */
|
||||
|
||||
Count = 0;
|
||||
- while ((Offset < Table->Length) &&
|
||||
- (DrtmRl->ResourceCount > Count))
|
||||
+ ResourceCount = AcpiUtReadUint32(&DrtmRl->ResourceCount);
|
||||
+ ResourceCount = AcpiUtReadUint32 (&DrtmRl->ResourceCount);
|
||||
+ while ((Offset < TableLength) &&
|
||||
+ (ResourceCount > Count))
|
||||
{
|
||||
@ -77,7 +77,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (void, Table, Offset),
|
||||
sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -775,7 +780,7 @@ AcpiDmDumpDrtm (
|
||||
@@ -853,7 +858,7 @@ AcpiDmDumpDrtm (
|
||||
|
||||
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -86,21 +86,21 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -775,7 +775,8 @@ DtCompileDrtm (
|
||||
--- 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));
|
||||
+ AcpiUtWriteUint (&DrtmVtl->ValidatedTableCount, sizeof (UINT32),
|
||||
+ &Count, sizeof (UINT32));
|
||||
DtPopSubtable ();
|
||||
ParentTable = DtPeekSubtable ();
|
||||
|
||||
@@ -813,7 +814,8 @@ DtCompileDrtm (
|
||||
@@ -887,7 +888,8 @@ DtCompileDrtm (
|
||||
Count++;
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
From b264cb9a07faa05e6d8e5e6c2381270c218d88c4 Mon Sep 17 00:00:00 2001
|
||||
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 11/40] Support EINJ in a big-endian world
|
||||
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-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -804,7 +804,7 @@ AcpiDmDumpEinj (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
|
||||
|
||||
|
||||
@@ -819,7 +819,7 @@ AcpiDmDumpEinj (
|
||||
@@ -897,7 +897,7 @@ AcpiDmDumpEinj (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
|
@ -1,27 +1,27 @@
|
||||
From 99f27aa1a38868a716aefd9408a8cd3788644d13 Mon Sep 17 00:00:00 2001
|
||||
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 12/40] Support ERST in a big-endian world
|
||||
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-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -857,7 +857,7 @@ AcpiDmDumpErst (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_ERST);
|
||||
|
||||
|
||||
@@ -872,7 +872,7 @@ AcpiDmDumpErst (
|
||||
@@ -950,7 +950,7 @@ AcpiDmDumpErst (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
|
@ -1,7 +1,7 @@
|
||||
From 3288b60b3ddc2df4656842d424bfc1e6a51b2ad2 Mon Sep 17 00:00:00 2001
|
||||
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 13/40] Support FADT (aka, FACP) in a big-endian world
|
||||
Subject: [PATCH 16/45] Support FADT (aka, FACP) in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/components/tables/tbfadt.c | 34 +++++++++++++++++++++++--------
|
||||
2 files changed, 38 insertions(+), 21 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
@@ -358,11 +358,12 @@ AcpiDmDumpFadt (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
|
||||
@ -27,7 +27,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
AcpiDmTableInfoFadt1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -371,10 +372,10 @@ AcpiDmDumpFadt (
|
||||
@@ -376,10 +377,10 @@ AcpiDmDumpFadt (
|
||||
|
||||
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
|
||||
|
||||
@ -41,7 +41,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
AcpiDmTableInfoFadt2);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -384,9 +385,9 @@ AcpiDmDumpFadt (
|
||||
@@ -389,9 +390,9 @@ AcpiDmDumpFadt (
|
||||
|
||||
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
|
||||
|
||||
@ -53,7 +53,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
AcpiDmTableInfoFadt3);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -395,9 +396,9 @@ AcpiDmDumpFadt (
|
||||
@@ -400,9 +401,9 @@ AcpiDmDumpFadt (
|
||||
|
||||
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
|
||||
|
||||
@ -65,7 +65,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
AcpiDmTableInfoFadt5);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -407,9 +408,9 @@ AcpiDmDumpFadt (
|
||||
@@ -412,9 +413,9 @@ AcpiDmDumpFadt (
|
||||
|
||||
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
|
||||
|
||||
@ -77,7 +77,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
AcpiDmTableInfoFadt6);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -420,11 +421,11 @@ AcpiDmDumpFadt (
|
||||
@@ -425,11 +426,11 @@ AcpiDmDumpFadt (
|
||||
|
||||
/* Validate various fields in the FADT, including length */
|
||||
|
||||
@ -91,10 +91,10 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
}
|
||||
|
||||
|
||||
Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
Index: acpica-unix2-20210604/source/components/tables/tbfadt.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/components/tables/tbfadt.c
|
||||
+++ acpica-unix2-20200925/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)
|
||||
@ -118,7 +118,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
* trusted.
|
||||
*/
|
||||
- if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
|
||||
+ if (AcpiUtReadUint32(&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;
|
||||
@ -128,8 +128,8 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
*/
|
||||
- AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
|
||||
+ Tmp = sizeof (ACPI_TABLE_FADT);
|
||||
+ AcpiUtWriteUint(&AcpiGbl_FADT.Header.Length, sizeof(UINT32),
|
||||
+ &Tmp, sizeof(UINT32));
|
||||
+ AcpiUtWriteUint (&AcpiGbl_FADT.Header.Length, sizeof (UINT32),
|
||||
+ &Tmp, sizeof (UINT32));
|
||||
|
||||
/*
|
||||
* Expand the 32-bit DSDT addresses to 64-bit as necessary.
|
||||
@ -137,11 +137,11 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
*/
|
||||
- AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
|
||||
- AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
|
||||
+ Value32 = AcpiUtReadUint32(&AcpiGbl_FADT.Dsdt);
|
||||
+ Value64 = AcpiUtReadUint64(&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));
|
||||
+ AcpiUtWriteUint (&AcpiGbl_FADT.XDsdt, sizeof (UINT64),
|
||||
+ &Value64, sizeof (UINT64));
|
||||
|
||||
/* If Hardware Reduced flag is set, we are all done */
|
||||
|
||||
@ -150,8 +150,8 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
if (Address64->Address)
|
||||
{
|
||||
- if (Address64->Address != (UINT64) Address32)
|
||||
+ Value32 = AcpiUtReadUint32(&Address32);
|
||||
+ Value64 = AcpiUtReadUint64(&Address64->Address);
|
||||
+ Value32 = AcpiUtReadUint32 (&Address32);
|
||||
+ Value64 = AcpiUtReadUint64 (&Address64->Address);
|
||||
+
|
||||
+ /* if (Address64->Address != (UINT64) Address32) */
|
||||
+ if (Value64 != (UINT64) Value32)
|
||||
@ -162,7 +162,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
*/
|
||||
if (!Address64->Address || AcpiGbl_Use32BitFadtAddresses)
|
||||
{
|
||||
+ Value32 = AcpiUtReadUint32(&Address32);
|
||||
+ Value32 = AcpiUtReadUint32 (&Address32);
|
||||
AcpiTbInitGenericAddress (Address64,
|
||||
ACPI_ADR_SPACE_SYSTEM_IO, Length,
|
||||
- (UINT64) Address32, Name, Flags);
|
||||
@ -176,7 +176,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
|
||||
{
|
||||
+ UINT64 Address64;
|
||||
+
|
||||
+ Address64 = AcpiUtReadUint64(&Source64->Address);
|
||||
+ Address64 = AcpiUtReadUint64 (&Source64->Address);
|
||||
+ Address64 +=
|
||||
+ (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth);
|
||||
AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target,
|
@ -1,7 +1,7 @@
|
||||
From f0cba59f1ce62095cb0a0cecdf8d661b77bf2baf Mon Sep 17 00:00:00 2001
|
||||
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 14/40] Support most FPDTs in a big-endian world
|
||||
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.
|
||||
@ -12,23 +12,23 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 4 +++-
|
||||
2 files changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -910,9 +910,10 @@ AcpiDmDumpFpdt (
|
||||
--- 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 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) */
|
||||
@@ -920,19 +921,20 @@ AcpiDmDumpFpdt (
|
||||
@@ -998,19 +999,20 @@ AcpiDmDumpFpdt (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
|
||||
@ -47,12 +47,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
}
|
||||
|
||||
- switch (Subtable->Type)
|
||||
+ SubtableType = AcpiUtReadUint16(&Subtable->Type);
|
||||
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
|
||||
+ switch (SubtableType)
|
||||
{
|
||||
case ACPI_FPDT_TYPE_BOOT:
|
||||
|
||||
@@ -959,7 +961,7 @@ AcpiDmDumpFpdt (
|
||||
@@ -1037,7 +1039,7 @@ AcpiDmDumpFpdt (
|
||||
goto NextSubtable;
|
||||
}
|
||||
|
||||
@ -61,11 +61,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Subtable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -1051,6 +1051,7 @@ DtCompileFpdt (
|
||||
--- 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;
|
||||
@ -73,12 +73,12 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
|
||||
|
||||
while (*PFieldList)
|
||||
@@ -1069,7 +1070,8 @@ DtCompileFpdt (
|
||||
@@ -1143,7 +1144,8 @@ DtCompileFpdt (
|
||||
|
||||
FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
|
||||
|
||||
- switch (FpdtHeader->Type)
|
||||
+ SubtableType = AcpiUtReadUint16(&FpdtHeader->Type);
|
||||
+ SubtableType = AcpiUtReadUint16 (&FpdtHeader->Type);
|
||||
+ switch (SubtableType)
|
||||
{
|
||||
case ACPI_FPDT_TYPE_BOOT:
|
@ -1,7 +1,7 @@
|
||||
From faba93b1dd7ce4aa8983880e917d108496cd173f Mon Sep 17 00:00:00 2001
|
||||
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 15/40] Support GTDT in a big-endian world
|
||||
Subject: [PATCH 18/45] Support GTDT in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,20 +9,20 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 9 +++++++--
|
||||
2 files changed, 16 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -997,7 +997,7 @@ AcpiDmDumpGtdt (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubtableLength;
|
||||
@@ -1033,7 +1033,7 @@ AcpiDmDumpGtdt (
|
||||
@@ -1111,7 +1111,7 @@ AcpiDmDumpGtdt (
|
||||
|
||||
/* Subtables */
|
||||
|
||||
@ -31,7 +31,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
@@ -1051,8 +1051,13 @@ AcpiDmDumpGtdt (
|
||||
@@ -1129,8 +1129,13 @@ AcpiDmDumpGtdt (
|
||||
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
||||
|
||||
SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
|
||||
@ -42,16 +42,16 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
+
|
||||
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
||||
+ Subtable))->TimerCount;
|
||||
+ GtCount = AcpiUtReadUint32(&Tmp32);
|
||||
+ GtCount = AcpiUtReadUint32 (&Tmp32);
|
||||
+ }
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt0;
|
||||
break;
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -997,8 +997,13 @@ DtCompileGtdt (
|
||||
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
@@ -1071,8 +1071,13 @@ DtCompileGtdt (
|
||||
DtPushSubtable (Subtable);
|
||||
ParentTable = DtPeekSubtable ();
|
||||
|
||||
@ -61,8 +61,8 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
+ UINT32 Tmp32;
|
||||
+
|
||||
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
||||
+ Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
|
||||
+ GtCount = AcpiUtReadUint32(&Tmp32);
|
||||
+ Subtable->Buffer - sizeof (ACPI_GTDT_HEADER)))->TimerCount;
|
||||
+ GtCount = AcpiUtReadUint32 (&Tmp32);
|
||||
+ }
|
||||
|
||||
while (GtCount)
|
@ -1,7 +1,7 @@
|
||||
From 1104928443b11ff1c0446ed1604882c0e6ae4dc1 Mon Sep 17 00:00:00 2001
|
||||
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 16/40] Support HEST in a big-endian world
|
||||
Subject: [PATCH 19/45] Support HEST in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,16 +9,16 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 4 +++-
|
||||
2 files changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -1138,12 +1138,13 @@ AcpiDmDumpHest (
|
||||
--- 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 Length = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_HEST);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubtableLength;
|
||||
@ -28,7 +28,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -1157,10 +1158,11 @@ AcpiDmDumpHest (
|
||||
@@ -1235,10 +1236,11 @@ AcpiDmDumpHest (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
|
||||
@ -42,7 +42,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
case ACPI_HEST_TYPE_IA32_CHECK:
|
||||
|
||||
@@ -1227,7 +1229,7 @@ AcpiDmDumpHest (
|
||||
@@ -1305,7 +1307,7 @@ AcpiDmDumpHest (
|
||||
/* Cannot continue on unknown type - no length */
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
|
||||
@ -51,11 +51,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
return;
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -1133,6 +1133,7 @@ DtCompileHest (
|
||||
--- 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;
|
||||
@ -63,13 +63,13 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
UINT32 BankCount;
|
||||
|
||||
|
||||
@@ -1151,7 +1152,8 @@ DtCompileHest (
|
||||
@@ -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);
|
||||
+ Type = AcpiUtReadUint32 (&Tmp16);
|
||||
|
||||
switch (Type)
|
||||
{
|
@ -1,26 +1,26 @@
|
||||
From 6565935b43c4795387aa4814d171dcd3c02bee33 Mon Sep 17 00:00:00 2001
|
||||
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 17/40] Support RSDT ('RSD PTR') in a big-endian world
|
||||
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-20200925/source/common/dmtbdump.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
@@ -277,6 +277,7 @@ AcpiDmDumpRsdt (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Point to start of table pointer array */
|
||||
@@ -286,12 +287,12 @@ AcpiDmDumpRsdt (
|
||||
@@ -291,12 +292,12 @@ AcpiDmDumpRsdt (
|
||||
|
||||
/* RSDT uses 32-bit pointers */
|
||||
|
||||
@ -31,7 +31,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
{
|
||||
AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
|
||||
- AcpiOsPrintf ("%8.8X\n", Array[i]);
|
||||
+ AcpiOsPrintf ("%8.8X\n", AcpiUtReadUint32(&Array[i]));
|
||||
+ AcpiOsPrintf ("%8.8X\n", AcpiUtReadUint32 (&Array[i]));
|
||||
Offset += sizeof (UINT32);
|
||||
}
|
||||
}
|
@ -1,26 +1,26 @@
|
||||
From 8d0ea4932cebc5d13cc811eb4f78b66a5e3cfd2c Mon Sep 17 00:00:00 2001
|
||||
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 18/40] Support XSDT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
@@ -318,6 +318,7 @@ AcpiDmDumpXsdt (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Point to start of table pointer array */
|
||||
@@ -327,12 +328,13 @@ AcpiDmDumpXsdt (
|
||||
@@ -332,12 +333,13 @@ AcpiDmDumpXsdt (
|
||||
|
||||
/* XSDT uses 64-bit pointers */
|
||||
|
||||
@ -32,7 +32,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
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])));
|
||||
+ ACPI_FORMAT_UINT64 (AcpiUtReadUint64 (&Array[i])));
|
||||
Offset += sizeof (UINT64);
|
||||
}
|
||||
}
|
@ -1,22 +1,22 @@
|
||||
From 82421dd7d534f78edf85b862b196bae256cf8f87 Mon Sep 17 00:00:00 2001
|
||||
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 19/40] Support SRAT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
@ -1,7 +1,7 @@
|
||||
From 4e76aa1a5556f250f51a3802734fd6cb77718299 Mon Sep 17 00:00:00 2001
|
||||
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 20/40] Support SLIT in a big-endian world
|
||||
Subject: [PATCH 23/45] Support SLIT in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable2.c | 2 +-
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -33,7 +33,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
|
||||
- Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
|
||||
+ Localities = (UINT32)
|
||||
+ AcpiUtReadUint64(&ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount);
|
||||
+ 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;
|
||||
|
||||
@ -46,16 +46,16 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"\n**** Not enough room in table for all localities\n");
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1529,7 +1529,7 @@ DtCompileSlit (
|
||||
--- 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);
|
||||
+ Localities = (UINT32) AcpiUtReadUint64 (Subtable->Buffer);
|
||||
LocalityBuffer = UtLocalCalloc (Localities);
|
||||
LocalityListLength = 0;
|
||||
|
@ -1,22 +1,22 @@
|
||||
From 4ca38d182bb40ba750d8f5ac6ff8560c40f06625 Mon Sep 17 00:00:00 2001
|
||||
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 21/40] Support MSCT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -972,11 +972,12 @@ AcpiDmDumpMsct (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -26,7 +26,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -985,12 +986,12 @@ AcpiDmDumpMsct (
|
||||
@@ -1146,12 +1147,12 @@ AcpiDmDumpMsct (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
|
@ -1,256 +0,0 @@
|
||||
From af44bec6c062a26034a43809d81af2a0ea17343e Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 16:05:59 -0600
|
||||
Subject: [PATCH 24/40] Support SDEV in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump2.c | 50 +++++++++++++++++++-----------------
|
||||
source/compiler/dttable2.c | 52 ++++++++++++++++++++++++++++----------
|
||||
2 files changed, 65 insertions(+), 37 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1871,17 +1871,18 @@ AcpiDmDumpSdev (
|
||||
ACPI_SDEV_PCIE *Pcie;
|
||||
ACPI_SDEV_NAMESPACE *Namesp;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
- UINT32 Length = Table->Length;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_SDEV);
|
||||
UINT16 PathOffset;
|
||||
UINT16 PathLength;
|
||||
UINT16 VendorDataOffset;
|
||||
UINT16 VendorDataLength;
|
||||
+ UINT16 SubtableLength;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSdev);
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSdev);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1890,13 +1891,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;
|
||||
@@ -1919,8 +1921,8 @@ AcpiDmDumpSdev (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
||||
- Subtable->Length, InfoTable);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1933,12 +1935,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, 0,
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0,
|
||||
ACPI_ADD_PTR (UINT8, Namesp, PathOffset),
|
||||
PathLength, AcpiDmTableInfoSdev0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1949,14 +1951,14 @@ AcpiDmDumpSdev (
|
||||
|
||||
/* Dump the vendor-specific data */
|
||||
|
||||
- VendorDataLength =
|
||||
- Namesp->VendorDataLength;
|
||||
- VendorDataOffset =
|
||||
- Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
|
||||
+ VendorDataLength = AcpiUtReadUint16(&Namesp->VendorDataLength);
|
||||
+ VendorDataOffset =
|
||||
+ 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))
|
||||
@@ -1971,12 +1973,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);
|
||||
@@ -1991,12 +1993,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))
|
||||
@@ -2013,8 +2017,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-20200925/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1268,6 +1268,7 @@ DtCompileSdev (
|
||||
ACPI_SDEV_PCIE *Pcie = NULL;
|
||||
ACPI_SDEV_NAMESPACE *Namesp = NULL;
|
||||
UINT32 EntryCount;
|
||||
+ UINT16 Tmp16;
|
||||
|
||||
|
||||
/* Subtables */
|
||||
@@ -1289,7 +1290,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)
|
||||
{
|
||||
@@ -1345,7 +1346,7 @@ DtCompileSdev (
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
- Namesp->DeviceIdOffset = sizeof (ACPI_SDEV_NAMESPACE);
|
||||
+ Namesp->DeviceIdOffset = (UINT16) sizeof (ACPI_SDEV_NAMESPACE);
|
||||
Namesp->DeviceIdLength = (UINT16) Subtable->Length;
|
||||
|
||||
/* Append Vendor data */
|
||||
@@ -1367,18 +1368,32 @@ DtCompileSdev (
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
- Namesp->VendorDataOffset =
|
||||
- Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
|
||||
- Namesp->VendorDataLength =
|
||||
- (UINT16) Subtable->Length;
|
||||
+ Namesp->VendorDataOffset =
|
||||
+ Namesp->DeviceIdOffset +
|
||||
+ Namesp->DeviceIdLength;
|
||||
+ Namesp->VendorDataLength = (UINT16) Subtable->Length;
|
||||
|
||||
/* Final size of entire namespace structure */
|
||||
|
||||
- SdevHeader->Length = (UINT16)(sizeof(ACPI_SDEV_NAMESPACE) +
|
||||
- Subtable->Length + Namesp->DeviceIdLength);
|
||||
+ SdevHeader->Length = (UINT16)
|
||||
+ (sizeof(ACPI_SDEV_NAMESPACE) +
|
||||
+ Subtable->Length +
|
||||
+ Namesp->DeviceIdLength);
|
||||
}
|
||||
}
|
||||
|
||||
+ /* 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:
|
||||
@@ -1408,9 +1423,9 @@ DtCompileSdev (
|
||||
|
||||
/* Path offset will point immediately after the main subtable */
|
||||
|
||||
- Pcie->PathOffset = sizeof (ACPI_SDEV_PCIE);
|
||||
+ Pcie->PathOffset = sizeof (ACPI_SDEV_PCIE);
|
||||
Pcie->PathLength = (UINT16)
|
||||
- (EntryCount * sizeof (ACPI_SDEV_PCIE_PATH));
|
||||
+ (EntryCount * sizeof (ACPI_SDEV_PCIE_PATH));
|
||||
|
||||
/* Append the Vendor Data last */
|
||||
|
||||
@@ -1432,15 +1447,24 @@ DtCompileSdev (
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
Pcie->VendorDataOffset =
|
||||
- Pcie->PathOffset + Pcie->PathLength;
|
||||
- Pcie->VendorDataLength = (UINT16)
|
||||
- Subtable->Length;
|
||||
+ Pcie->PathOffset + Pcie->PathLength;
|
||||
+ Pcie->VendorDataLength = (UINT16) Subtable->Length;
|
||||
}
|
||||
}
|
||||
|
||||
SdevHeader->Length =
|
||||
- sizeof (ACPI_SDEV_PCIE) +
|
||||
+ 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:
|
@ -1,7 +1,7 @@
|
||||
From dfe414b053fb9feb905271785b319afa7ba72932 Mon Sep 17 00:00:00 2001
|
||||
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 22/40] Support MPST in a big-endian world
|
||||
Subject: [PATCH 25/45] Support MPST in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable2.c | 8 ++++----
|
||||
2 files changed, 23 insertions(+), 18 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -834,11 +834,13 @@ AcpiDmDumpMpst (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
+ UINT16 Tmp16;
|
||||
|
||||
|
||||
@ -28,13 +28,13 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -846,13 +848,14 @@ AcpiDmDumpMpst (
|
||||
@@ -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);
|
||||
+ SubtableCount = AcpiUtReadUint16 (&Tmp16);
|
||||
Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
|
||||
|
||||
- while ((Offset < Table->Length) && SubtableCount)
|
||||
@ -46,18 +46,18 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -861,8 +864,8 @@ AcpiDmDumpMpst (
|
||||
@@ -1022,8 +1025,8 @@ AcpiDmDumpMpst (
|
||||
|
||||
/* Extract the sub-subtable counts */
|
||||
|
||||
- PowerStateCount = Subtable0->NumPowerStates;
|
||||
- ComponentCount = Subtable0->NumPhysicalComponents;
|
||||
+ PowerStateCount = AcpiUtReadUint16(&Subtable0->NumPowerStates);
|
||||
+ ComponentCount = AcpiUtReadUint16(&Subtable0->NumPhysicalComponents);
|
||||
+ PowerStateCount = AcpiUtReadUint16 (&Subtable0->NumPowerStates);
|
||||
+ ComponentCount = AcpiUtReadUint16 (&Subtable0->NumPhysicalComponents);
|
||||
Offset += sizeof (ACPI_MPST_POWER_NODE);
|
||||
|
||||
/* Sub-subtables - Memory Power State Structure(s) */
|
||||
@@ -873,7 +876,7 @@ AcpiDmDumpMpst (
|
||||
@@ -1034,7 +1037,7 @@ AcpiDmDumpMpst (
|
||||
while (PowerStateCount)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -66,7 +66,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -896,7 +899,7 @@ AcpiDmDumpMpst (
|
||||
@@ -1057,7 +1060,7 @@ AcpiDmDumpMpst (
|
||||
|
||||
while (ComponentCount)
|
||||
{
|
||||
@ -75,16 +75,16 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -913,22 +916,24 @@ AcpiDmDumpMpst (
|
||||
@@ -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)) +
|
||||
+ AcpiUtReadUint16 (&Subtable0->NumPowerStates)) +
|
||||
+ (sizeof (ACPI_MPST_COMPONENT) *
|
||||
+ AcpiUtReadUint16(&Subtable0->NumPhysicalComponents)));
|
||||
+ AcpiUtReadUint16 (&Subtable0->NumPhysicalComponents)));
|
||||
}
|
||||
|
||||
/* Subtable: Count of Memory Power State Characteristic structures */
|
||||
@ -100,11 +100,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
}
|
||||
|
||||
- SubtableCount = Subtable1->CharacteristicsCount;
|
||||
+ SubtableCount = AcpiUtReadUint16(&Subtable1->CharacteristicsCount);
|
||||
+ SubtableCount = AcpiUtReadUint16 (&Subtable1->CharacteristicsCount);
|
||||
Offset += sizeof (ACPI_MPST_DATA_HDR);
|
||||
|
||||
/* Subtable: Memory Power State Characteristics structure(s) */
|
||||
@@ -936,10 +941,10 @@ AcpiDmDumpMpst (
|
||||
@@ -1097,10 +1102,10 @@ AcpiDmDumpMpst (
|
||||
Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1,
|
||||
sizeof (ACPI_MPST_DATA_HDR));
|
||||
|
||||
@ -117,31 +117,31 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -345,7 +345,7 @@ DtCompileMpst (
|
||||
--- 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);
|
||||
+ SubtableCount = AcpiUtReadUint16 (&MpstChannelInfo->PowerNodeCount);
|
||||
|
||||
while (*PFieldList && SubtableCount)
|
||||
{
|
||||
@@ -363,8 +363,8 @@ DtCompileMpst (
|
||||
@@ -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);
|
||||
+ PowerStateCount = AcpiUtReadUint16 (&MpstPowerNode->NumPowerStates);
|
||||
+ ComponentCount = AcpiUtReadUint16 (&MpstPowerNode->NumPhysicalComponents);
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
|
||||
@@ -417,7 +417,7 @@ DtCompileMpst (
|
||||
@@ -422,7 +422,7 @@ DtCompileMpst (
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
|
@ -1,25 +1,28 @@
|
||||
From 2a1f049c35736ddba45300bc5aba4db9c9df3be7 Mon Sep 17 00:00:00 2001
|
||||
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 23/40] Support NFIT in a big-endian world
|
||||
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 | 47 +++++++++++++++++++++++---------------
|
||||
source/common/dmtbdump2.c | 49 ++++++++++++++++++++++----------------
|
||||
source/compiler/dttable2.c | 11 ++++++---
|
||||
3 files changed, 38 insertions(+), 24 deletions(-)
|
||||
3 files changed, 39 insertions(+), 25 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtable.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtable.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtable.c
|
||||
@@ -1429,13 +1429,13 @@ AcpiDmDumpTable (
|
||||
--- 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);
|
||||
+ Temp16 = AcpiUtReadUint16 (Target);
|
||||
if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
|
||||
{
|
||||
Temp16 = ACPI_NFIT_TYPE_RESERVED;
|
||||
@ -30,16 +33,16 @@ Index: acpica-unix2-20200925/source/common/dmtable.c
|
||||
AcpiDmNfitSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1084,18 +1084,23 @@ AcpiDmDumpNfit (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
ACPI_NFIT_HEADER *Subtable;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
ACPI_NFIT_INTERLEAVE *Interleave = NULL;
|
||||
@ -60,7 +63,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1104,19 +1109,21 @@ AcpiDmDumpNfit (
|
||||
@@ -1212,19 +1217,21 @@ AcpiDmDumpNfit (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
|
||||
@ -72,8 +75,8 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoNfitHdr);
|
||||
+ SubtableType = AcpiUtReadUint16(&Subtable->Type);
|
||||
+ SubtableLength = AcpiUtReadUint16(&Subtable->Length);
|
||||
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
|
||||
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, AcpiDmTableInfoNfitHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@ -86,7 +89,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
{
|
||||
case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
|
||||
|
||||
@@ -1167,11 +1174,11 @@ AcpiDmDumpNfit (
|
||||
@@ -1275,11 +1282,11 @@ AcpiDmDumpNfit (
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
|
||||
@ -100,7 +103,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
{
|
||||
AcpiOsPrintf ("Invalid zero length subtable\n");
|
||||
return;
|
||||
@@ -1180,8 +1187,8 @@ AcpiDmDumpNfit (
|
||||
@@ -1288,8 +1295,8 @@ AcpiDmDumpNfit (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -111,7 +114,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1189,14 +1196,15 @@ AcpiDmDumpNfit (
|
||||
@@ -1297,14 +1304,15 @@ AcpiDmDumpNfit (
|
||||
|
||||
/* Per-subtable variable-length fields */
|
||||
|
||||
@ -122,7 +125,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
|
||||
Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable);
|
||||
- for (i = 0; i < Interleave->LineCount; i++)
|
||||
+ LineCount = AcpiUtReadUint32(&Interleave->LineCount);
|
||||
+ LineCount = AcpiUtReadUint32 (&Interleave->LineCount);
|
||||
+ for (i = 0; i < LineCount; i++)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
|
||||
@ -130,7 +133,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
&Interleave->LineOffset[i],
|
||||
sizeof (UINT32), AcpiDmTableInfoNfit2a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1210,12 +1218,12 @@ AcpiDmDumpNfit (
|
||||
@@ -1318,14 +1326,14 @@ AcpiDmDumpNfit (
|
||||
|
||||
case ACPI_NFIT_TYPE_SMBIOS:
|
||||
|
||||
@ -143,14 +146,17 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
- Status = AcpiDmDumpTable (Table->Length,
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
|
||||
SmbiosInfo,
|
||||
- SmbiosInfo,
|
||||
+ SmbiosInfo + Offset,
|
||||
Length, AcpiDmTableInfoNfit3a);
|
||||
@@ -1230,9 +1238,10 @@ AcpiDmDumpNfit (
|
||||
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);
|
||||
+ HintCount = AcpiUtReadUint16 (&Hint->HintCount);
|
||||
+ for (i = 0; i < HintCount; i++)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
|
||||
@ -158,7 +164,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
&Hint->HintAddress[i],
|
||||
sizeof (UINT64), AcpiDmTableInfoNfit6a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1251,8 +1260,8 @@ AcpiDmDumpNfit (
|
||||
@@ -1359,8 +1368,8 @@ AcpiDmDumpNfit (
|
||||
NextSubtable:
|
||||
/* Point to next subtable */
|
||||
|
||||
@ -169,11 +175,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
}
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -517,6 +517,7 @@ DtCompileNfit (
|
||||
--- 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;
|
||||
@ -181,17 +187,17 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -550,7 +551,8 @@ DtCompileNfit (
|
||||
@@ -530,7 +531,8 @@ DtCompileNfit (
|
||||
|
||||
NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
|
||||
|
||||
- switch (NfitHeader->Type)
|
||||
+ NfitHeaderType = AcpiUtReadUint16(&NfitHeader->Type);
|
||||
+ NfitHeaderType = AcpiUtReadUint16 (&NfitHeader->Type);
|
||||
+ switch (NfitHeaderType)
|
||||
{
|
||||
case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
|
||||
|
||||
@@ -610,7 +612,7 @@ DtCompileNfit (
|
||||
@@ -590,7 +592,7 @@ DtCompileNfit (
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
DtPopSubtable ();
|
||||
|
||||
@ -200,22 +206,22 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
{
|
||||
case ACPI_NFIT_TYPE_INTERLEAVE:
|
||||
|
||||
@@ -636,7 +638,8 @@ DtCompileNfit (
|
||||
@@ -616,7 +618,8 @@ DtCompileNfit (
|
||||
Count++;
|
||||
}
|
||||
|
||||
- Interleave->LineCount = Count;
|
||||
+ AcpiUtWriteUint(&Interleave->LineCount, sizeof(UINT32),
|
||||
+ &Count, sizeof(UINT32));
|
||||
+ AcpiUtWriteUint (&Interleave->LineCount, sizeof (UINT32),
|
||||
+ &Count, sizeof (UINT32));
|
||||
break;
|
||||
|
||||
case ACPI_NFIT_TYPE_SMBIOS:
|
||||
@@ -682,6 +685,8 @@ DtCompileNfit (
|
||||
@@ -662,6 +665,8 @@ DtCompileNfit (
|
||||
}
|
||||
|
||||
Hint->HintCount = (UINT16) Count;
|
||||
+ AcpiUtWriteUint(&Hint->HintCount, sizeof(UINT16),
|
||||
+ &Count, sizeof(UINT32));
|
||||
+ AcpiUtWriteUint (&Hint->HintCount, sizeof (UINT16),
|
||||
+ &Count, sizeof (UINT32));
|
||||
break;
|
||||
|
||||
default:
|
206
0027-Support-SDEV-in-a-big-endian-world.patch
Normal file
206
0027-Support-SDEV-in-a-big-endian-world.patch
Normal file
@ -0,0 +1,206 @@
|
||||
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:
|
@ -1,7 +1,7 @@
|
||||
From 03425774d2c19874ad4483ec6b7e13c0146e81f7 Mon Sep 17 00:00:00 2001
|
||||
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 25/40] Support HMAT in a big-endian world
|
||||
Subject: [PATCH 28/45] Support HMAT in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable1.c | 24 ++++++++++---
|
||||
2 files changed, 59 insertions(+), 35 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
@@ -1301,37 +1301,45 @@ AcpiDmDumpHmat (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
+ UINT16 HmatStructType;
|
||||
+ UINT32 HmatStructLength;
|
||||
+ UINT32 InitPDs;
|
||||
@ -44,7 +44,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
|
||||
- if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
|
||||
+ HmatStructLength = AcpiUtReadUint32(&HmatStruct->Length);
|
||||
+ HmatStructLength = AcpiUtReadUint32 (&HmatStruct->Length);
|
||||
+ if (HmatStructLength < sizeof (ACPI_HMAT_STRUCTURE))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid HMAT structure length\n");
|
||||
@ -60,12 +60,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
}
|
||||
|
||||
- switch (HmatStruct->Type)
|
||||
+ HmatStructType = AcpiUtReadUint16(&HmatStruct->Type);
|
||||
+ HmatStructType = AcpiUtReadUint16 (&HmatStruct->Type);
|
||||
+ switch (HmatStructType)
|
||||
{
|
||||
case ACPI_HMAT_TYPE_ADDRESS_RANGE:
|
||||
|
||||
@@ -1354,7 +1362,7 @@ AcpiDmDumpHmat (
|
||||
@@ -1432,7 +1440,7 @@ AcpiDmDumpHmat (
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
|
||||
@ -74,7 +74,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -1363,13 +1371,13 @@ AcpiDmDumpHmat (
|
||||
@@ -1441,13 +1449,13 @@ AcpiDmDumpHmat (
|
||||
|
||||
/* Dump HMAT structure body */
|
||||
|
||||
@ -91,7 +91,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1377,7 +1385,7 @@ AcpiDmDumpHmat (
|
||||
@@ -1455,7 +1463,7 @@ AcpiDmDumpHmat (
|
||||
|
||||
/* Dump HMAT structure additionals */
|
||||
|
||||
@ -100,15 +100,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
{
|
||||
case ACPI_HMAT_TYPE_LOCALITY:
|
||||
|
||||
@@ -1386,15 +1394,16 @@ AcpiDmDumpHmat (
|
||||
@@ -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))
|
||||
+ InitPDs = AcpiUtReadUint32 (&HmatLocality->NumberOfInitiatorPDs);
|
||||
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
|
||||
+ (UINT32) (InitPDs * 4))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid initiator proximity domain number\n");
|
||||
return;
|
||||
@ -121,15 +121,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
|
||||
4, AcpiDmTableInfoHmat1a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1407,15 +1416,16 @@ AcpiDmDumpHmat (
|
||||
@@ -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))
|
||||
+ TgtPDs = AcpiUtReadUint32 (&HmatLocality->NumberOfTargetPDs);
|
||||
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
|
||||
+ (UINT32) (TgtPDs * 4))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid target proximity domain number\n");
|
||||
return;
|
||||
@ -142,15 +142,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
|
||||
4, AcpiDmTableInfoHmat1b);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1428,18 +1438,17 @@ AcpiDmDumpHmat (
|
||||
@@ -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))
|
||||
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
|
||||
+ (UINT32) (InitPDs * TgtPDs * 2))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
|
||||
return;
|
||||
@ -166,15 +166,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
|
||||
2, AcpiDmTableInfoHmat1c);
|
||||
if (ACPI_FAILURE(Status))
|
||||
@@ -1459,15 +1468,16 @@ AcpiDmDumpHmat (
|
||||
@@ -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))
|
||||
+ SMBIOSHandles = AcpiUtReadUint16 (&HmatCache->NumberOfSMBIOSHandles);
|
||||
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
|
||||
+ (UINT32) (SMBIOSHandles * 2))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid SMBIOS handle number\n");
|
||||
return;
|
||||
@ -187,7 +187,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
|
||||
2, AcpiDmTableInfoHmat2a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1487,6 +1497,6 @@ AcpiDmDumpHmat (
|
||||
@@ -1565,6 +1575,6 @@ AcpiDmDumpHmat (
|
||||
NextSubtable:
|
||||
/* Point to next HMAT structure subtable */
|
||||
|
||||
@ -195,11 +195,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump1.c
|
||||
+ Offset += (HmatStructLength);
|
||||
}
|
||||
}
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -1295,6 +1295,8 @@ DtCompileHmat (
|
||||
--- 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;
|
||||
@ -208,17 +208,17 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
@@ -1325,7 +1327,8 @@ DtCompileHmat (
|
||||
@@ -1399,7 +1401,8 @@ DtCompileHmat (
|
||||
|
||||
/* Compile HMAT structure body */
|
||||
|
||||
- switch (HmatStruct->Type)
|
||||
+ HmatStructType = AcpiUtReadUint16(&HmatStruct->Type);
|
||||
+ HmatStructType = AcpiUtReadUint16 (&HmatStruct->Type);
|
||||
+ switch (HmatStructType)
|
||||
{
|
||||
case ACPI_HMAT_TYPE_ADDRESS_RANGE:
|
||||
|
||||
@@ -1358,7 +1361,7 @@ DtCompileHmat (
|
||||
@@ -1432,7 +1435,7 @@ DtCompileHmat (
|
||||
|
||||
/* Compile HMAT structure additionals */
|
||||
|
||||
@ -227,43 +227,43 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
{
|
||||
case ACPI_HMAT_TYPE_LOCALITY:
|
||||
|
||||
@@ -1384,7 +1387,7 @@ DtCompileHmat (
|
||||
@@ -1458,7 +1461,7 @@ DtCompileHmat (
|
||||
HmatStruct->Length += Subtable->Length;
|
||||
IntPDNumber++;
|
||||
}
|
||||
- HmatLocality->NumberOfInitiatorPDs = IntPDNumber;
|
||||
+ HmatLocality->NumberOfInitiatorPDs = AcpiUtReadUint32(&IntPDNumber);
|
||||
+ HmatLocality->NumberOfInitiatorPDs = AcpiUtReadUint32 (&IntPDNumber);
|
||||
|
||||
/* Compile target proximity domain list */
|
||||
|
||||
@@ -1405,7 +1408,7 @@ DtCompileHmat (
|
||||
@@ -1479,7 +1482,7 @@ DtCompileHmat (
|
||||
HmatStruct->Length += Subtable->Length;
|
||||
TgtPDNumber++;
|
||||
}
|
||||
- HmatLocality->NumberOfTargetPDs = TgtPDNumber;
|
||||
+ HmatLocality->NumberOfTargetPDs = AcpiUtReadUint32(&TgtPDNumber);
|
||||
+ HmatLocality->NumberOfTargetPDs = AcpiUtReadUint32 (&TgtPDNumber);
|
||||
|
||||
/* Save start of the entries for reporting errors */
|
||||
|
||||
@@ -1430,6 +1433,9 @@ DtCompileHmat (
|
||||
HmatStruct->Length += Subtable->Length;
|
||||
@@ -1505,6 +1508,9 @@ DtCompileHmat (
|
||||
EntryNumber++;
|
||||
}
|
||||
+
|
||||
+ Length = AcpiUtReadUint32(&HmatStruct->Length);
|
||||
+ HmatStruct->Length = Length;
|
||||
|
||||
+ Length = AcpiUtReadUint32 (&HmatStruct->Length);
|
||||
+ HmatStruct->Length = Length;
|
||||
+
|
||||
/* Validate number of entries */
|
||||
|
||||
@@ -1464,11 +1470,19 @@ DtCompileHmat (
|
||||
if (EntryNumber !=
|
||||
@@ -1538,11 +1544,19 @@ DtCompileHmat (
|
||||
HmatStruct->Length += Subtable->Length;
|
||||
SMBIOSHandleNumber++;
|
||||
}
|
||||
- HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber;
|
||||
+ HmatCache->NumberOfSMBIOSHandles =
|
||||
+ AcpiUtReadUint16(&SMBIOSHandleNumber);
|
||||
+ AcpiUtReadUint16 (&SMBIOSHandleNumber);
|
||||
+
|
||||
+ Length = AcpiUtReadUint32(&HmatStruct->Length);
|
||||
+ Length = AcpiUtReadUint32 (&HmatStruct->Length);
|
||||
+ HmatStruct->Length = Length;
|
||||
+
|
||||
break;
|
@ -1,23 +1,23 @@
|
||||
From afaa9043357a3b8adbaa1ea389a62da48f561896 Mon Sep 17 00:00:00 2001
|
||||
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 26/40] Support PDTT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1385,13 +1385,13 @@ AcpiDmDumpPdtt (
|
||||
--- 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 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_PDTT);
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1400,10 +1400,10 @@ AcpiDmDumpPdtt (
|
||||
@@ -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);
|
@ -1,28 +1,28 @@
|
||||
From c5d7294c6deb7fe87eac981234d4c484313d5e40 Mon Sep 17 00:00:00 2001
|
||||
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 27/40] Support PPTT in a big-endian world
|
||||
Subject: [PATCH 30/45] Support PPTT in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump2.c | 15 +++++++++------
|
||||
source/common/dmtbdump2.c | 17 ++++++++++-------
|
||||
source/compiler/dttable2.c | 7 +++++--
|
||||
2 files changed, 14 insertions(+), 8 deletions(-)
|
||||
2 files changed, 15 insertions(+), 9 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1649,6 +1649,8 @@ AcpiDmDumpPptt (
|
||||
--- 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 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
+ UINT32 NumPrivRes;
|
||||
|
||||
|
||||
/* There is no main table (other than the standard ACPI header) */
|
||||
@@ -1656,7 +1658,7 @@ AcpiDmDumpPptt (
|
||||
@@ -1792,7 +1794,7 @@ AcpiDmDumpPptt (
|
||||
/* Subtables */
|
||||
|
||||
Offset = sizeof (ACPI_TABLE_HEADER);
|
||||
@ -31,7 +31,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
@@ -1668,7 +1670,7 @@ AcpiDmDumpPptt (
|
||||
@@ -1804,7 +1806,7 @@ AcpiDmDumpPptt (
|
||||
AcpiOsPrintf ("Invalid subtable length\n");
|
||||
return;
|
||||
}
|
||||
@ -40,7 +40,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Subtable->Length, AcpiDmTableInfoPpttHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1710,7 +1712,7 @@ AcpiDmDumpPptt (
|
||||
@@ -1846,7 +1848,7 @@ AcpiDmDumpPptt (
|
||||
AcpiOsPrintf ("Invalid subtable length\n");
|
||||
return;
|
||||
}
|
||||
@ -49,14 +49,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Subtable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1726,15 +1728,16 @@ AcpiDmDumpPptt (
|
||||
@@ -1862,15 +1864,16 @@ AcpiDmDumpPptt (
|
||||
|
||||
/* Dump SMBIOS handles */
|
||||
|
||||
+ NumPrivRes = AcpiUtReadUint32(&PpttProcessor->NumberOfPrivResources);
|
||||
if ((UINT8)(Subtable->Length - SubtableOffset) <
|
||||
- if ((UINT8)(Subtable->Length - SubtableOffset) <
|
||||
- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
|
||||
+ (UINT8)(NumPrivRes * 4))
|
||||
+ NumPrivRes = AcpiUtReadUint32 (&PpttProcessor->NumberOfPrivResources);
|
||||
+ if ((UINT8) (Subtable->Length - SubtableOffset) <
|
||||
+ (UINT8) (NumPrivRes * 4))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid private resource number\n");
|
||||
return;
|
||||
@ -69,19 +70,19 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
|
||||
4, AcpiDmTableInfoPptt0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1028,6 +1028,7 @@ DtCompilePptt (
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
--- 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 ();
|
||||
@@ -1092,7 +1093,7 @@ DtCompilePptt (
|
||||
@@ -1187,7 +1188,7 @@ DtCompilePptt (
|
||||
{
|
||||
/* Compile initiator proximity domain list */
|
||||
|
||||
@ -90,7 +91,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
while (*PFieldList)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList,
|
||||
@@ -1108,8 +1109,10 @@ DtCompilePptt (
|
||||
@@ -1203,8 +1204,10 @@ DtCompilePptt (
|
||||
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
PpttHeader->Length += (UINT8)(Subtable->Length);
|
||||
@ -98,7 +99,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
+ NumPrivRes++;
|
||||
}
|
||||
+ PpttProcessor->NumberOfPrivResources =
|
||||
+ AcpiUtReadUint32(&NumPrivRes);
|
||||
+ AcpiUtReadUint32 (&NumPrivRes);
|
||||
}
|
||||
break;
|
||||
|
@ -1,23 +1,23 @@
|
||||
From 661f59c00e991553fb3f5fe7786eb0e2f640805c Mon Sep 17 00:00:00 2001
|
||||
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 28/40] Support PCCT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1286,13 +1286,13 @@ AcpiDmDumpPcct (
|
||||
--- 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 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1301,12 +1301,12 @@ AcpiDmDumpPcct (
|
||||
@@ -1409,12 +1409,12 @@ AcpiDmDumpPcct (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
|
||||
@ -43,7 +43,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Subtable->Header.Length, AcpiDmTableInfoPcctHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1349,7 +1349,7 @@ AcpiDmDumpPcct (
|
||||
@@ -1462,7 +1462,7 @@ AcpiDmDumpPcct (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
@ -1,27 +0,0 @@
|
||||
From 0455d918688d9d208644d7f5f6f10d6199486e9c Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Mon, 28 Sep 2020 12:49:23 -0600
|
||||
Subject: [PATCH 32/40] Support SLIC and MSDM in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump3.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -68,9 +68,10 @@ 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), Table,
|
||||
+ TableLength - sizeof (*Table), AcpiDmTableInfoSlic);
|
||||
}
|
||||
|
||||
|
@ -1,22 +1,22 @@
|
||||
From 520e143b2bacb39032c06a33f61ae05583be6b2a Mon Sep 17 00:00:00 2001
|
||||
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 29/40] Support WDAT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -568,11 +568,12 @@ AcpiDmDumpWdat (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -26,7 +26,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -581,12 +582,12 @@ AcpiDmDumpWdat (
|
||||
@@ -688,12 +689,12 @@ AcpiDmDumpWdat (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
|
@ -1,7 +1,7 @@
|
||||
From b2e9a4397077ad56fea5a8b3f9f63ce3be65ae48 Mon Sep 17 00:00:00 2001
|
||||
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 30/40] Support TCPA in a big-endian world
|
||||
Subject: [PATCH 33/45] Support TCPA in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable2.c | 4 +++-
|
||||
2 files changed, 11 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -342,11 +342,13 @@ AcpiDmDumpTcpa (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
+ UINT16 PlatformClass;
|
||||
|
||||
|
||||
@ -28,12 +28,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
0, AcpiDmTableInfoTcpaHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -357,18 +359,19 @@ AcpiDmDumpTcpa (
|
||||
@@ -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);
|
||||
+ PlatformClass = AcpiUtReadUint16 (&CommonHeader->PlatformClass);
|
||||
+ switch (PlatformClass)
|
||||
{
|
||||
case ACPI_TCPA_CLIENT_TABLE:
|
||||
@ -52,11 +52,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
break;
|
||||
|
||||
default:
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1773,6 +1773,7 @@ DtCompileTcpa (
|
||||
--- 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;
|
||||
@ -64,12 +64,12 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
|
||||
|
||||
/* Compile the main table */
|
||||
@@ -1793,7 +1794,8 @@ DtCompileTcpa (
|
||||
@@ -2159,7 +2160,8 @@ DtCompileTcpa (
|
||||
*/
|
||||
TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
|
||||
|
||||
- switch (TcpaHeader->PlatformClass)
|
||||
+ PlatformClass = AcpiUtReadUint16(&TcpaHeader->PlatformClass);
|
||||
+ PlatformClass = AcpiUtReadUint16 (&TcpaHeader->PlatformClass);
|
||||
+ switch (PlatformClass)
|
||||
{
|
||||
case ACPI_TCPA_CLIENT_TABLE:
|
@ -1,23 +1,23 @@
|
||||
From 63fc38478f12b8c8b0d263d25f72ff7538fba2ce Mon Sep 17 00:00:00 2001
|
||||
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 31/40] Support STAO in a big-endian world
|
||||
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-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/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 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 StringLength;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_STAO);
|
||||
|
@ -1,216 +0,0 @@
|
||||
From b55af37d2419fc5ea630774f49b4ed9b724451b3 Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Mon, 28 Sep 2020 18:37:04 -0600
|
||||
Subject: [PATCH 35/40] Support PMTT in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump2.c | 66 +++++++++++++++++++++-----------------
|
||||
source/compiler/dttable2.c | 5 ++-
|
||||
2 files changed, 41 insertions(+), 30 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1442,17 +1442,21 @@ AcpiDmDumpPmtt (
|
||||
ACPI_PMTT_HEADER *MemSubtable;
|
||||
ACPI_PMTT_HEADER *DimmSubtable;
|
||||
ACPI_PMTT_DOMAIN *DomainArray;
|
||||
- UINT32 Length = Table->Length;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_PMTT);
|
||||
UINT32 MemOffset;
|
||||
UINT32 DimmOffset;
|
||||
UINT32 DomainOffset;
|
||||
UINT32 DomainCount;
|
||||
+ UINT16 SubtableLength;
|
||||
+ UINT16 MemSubtableLength;
|
||||
+ UINT16 DimmSubtableLength;
|
||||
+ UINT16 Tmp16;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoPmtt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1461,13 +1465,14 @@ AcpiDmDumpPmtt (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
|
||||
- while (Offset < Table->Length)
|
||||
+ while (Offset < TableLength)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoPmttHdr);
|
||||
+ SubtableLength = AcpiUtReadUint16(&Subtable->Length);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, AcpiDmTableInfoPmttHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1485,8 +1490,8 @@ AcpiDmDumpPmtt (
|
||||
|
||||
/* Dump the fixed-length portion of the subtable */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoPmtt0);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, AcpiDmTableInfoPmtt0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1498,15 +1503,16 @@ AcpiDmDumpPmtt (
|
||||
MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable,
|
||||
sizeof (ACPI_PMTT_SOCKET));
|
||||
|
||||
- while (((Offset + MemOffset) < Table->Length) &&
|
||||
- (MemOffset < Subtable->Length))
|
||||
+ while (((Offset + MemOffset) < TableLength) &&
|
||||
+ (MemOffset < SubtableLength))
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Length,
|
||||
+ MemSubtableLength = AcpiUtReadUint16(&MemSubtable->Length);
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
Offset + MemOffset, MemSubtable,
|
||||
- MemSubtable->Length, AcpiDmTableInfoPmttHdr);
|
||||
+ MemSubtableLength, AcpiDmTableInfoPmttHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1524,9 +1530,9 @@ AcpiDmDumpPmtt (
|
||||
|
||||
/* Dump the fixed-length portion of the controller subtable */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length,
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
Offset + MemOffset, MemSubtable,
|
||||
- MemSubtable->Length, AcpiDmTableInfoPmtt1);
|
||||
+ MemSubtableLength, AcpiDmTableInfoPmtt1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1534,16 +1540,17 @@ AcpiDmDumpPmtt (
|
||||
|
||||
/* Walk the variable count of proximity domains */
|
||||
|
||||
- DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount;
|
||||
+ Tmp16 = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount;
|
||||
+ DomainCount = AcpiUtReadUint16(&Tmp16);
|
||||
DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
|
||||
DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubtable,
|
||||
sizeof (ACPI_PMTT_CONTROLLER));
|
||||
|
||||
- while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
|
||||
- ((MemOffset + DomainOffset) < Subtable->Length) &&
|
||||
+ while (((Offset + MemOffset + DomainOffset) < TableLength) &&
|
||||
+ ((MemOffset + DomainOffset) < SubtableLength) &&
|
||||
DomainCount)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Length,
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
Offset + MemOffset + DomainOffset, DomainArray,
|
||||
sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1568,15 +1575,16 @@ AcpiDmDumpPmtt (
|
||||
DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubtable,
|
||||
DomainOffset);
|
||||
|
||||
- while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
|
||||
- (DimmOffset < MemSubtable->Length))
|
||||
+ while (((Offset + MemOffset + DimmOffset) < TableLength) &&
|
||||
+ (DimmOffset < MemSubtableLength))
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Length,
|
||||
+ DimmSubtableLength = AcpiUtReadUint16(&DimmSubtable->Length);
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
Offset + MemOffset + DimmOffset, DimmSubtable,
|
||||
- DimmSubtable->Length, AcpiDmTableInfoPmttHdr);
|
||||
+ DimmSubtableLength, AcpiDmTableInfoPmttHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1594,9 +1602,9 @@ AcpiDmDumpPmtt (
|
||||
|
||||
/* Dump the fixed-length DIMM subtable */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length,
|
||||
+ Status = AcpiDmDumpTable (TableLength,
|
||||
Offset + MemOffset + DimmOffset, DimmSubtable,
|
||||
- DimmSubtable->Length, AcpiDmTableInfoPmtt2);
|
||||
+ DimmSubtableLength, AcpiDmTableInfoPmtt2);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1604,23 +1612,23 @@ AcpiDmDumpPmtt (
|
||||
|
||||
/* Point to next DIMM subtable */
|
||||
|
||||
- DimmOffset += DimmSubtable->Length;
|
||||
+ DimmOffset += DimmSubtableLength;
|
||||
DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
|
||||
- DimmSubtable, DimmSubtable->Length);
|
||||
+ DimmSubtable, DimmSubtableLength);
|
||||
}
|
||||
|
||||
/* Point to next Controller subtable */
|
||||
|
||||
- MemOffset += MemSubtable->Length;
|
||||
+ MemOffset += MemSubtableLength;
|
||||
MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
|
||||
- MemSubtable, MemSubtable->Length);
|
||||
+ MemSubtable, MemSubtableLength);
|
||||
}
|
||||
|
||||
/* Point to next Socket subtable */
|
||||
|
||||
- Offset += Subtable->Length;
|
||||
+ Offset += SubtableLength;
|
||||
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
|
||||
- Subtable, Subtable->Length);
|
||||
+ Subtable, SubtableLength);
|
||||
}
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -885,6 +885,7 @@ DtCompilePmtt (
|
||||
ACPI_PMTT_HEADER *PmttHeader;
|
||||
ACPI_PMTT_CONTROLLER *PmttController;
|
||||
UINT16 DomainCount;
|
||||
+ UINT16 Length;
|
||||
UINT8 PrevType = ACPI_PMTT_TYPE_SOCKET;
|
||||
|
||||
|
||||
@@ -929,6 +930,8 @@ DtCompilePmtt (
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
+ Length = AcpiUtReadUint16(&PmttHeader->Length);
|
||||
+ PmttHeader->Length = Length;
|
||||
switch (PmttHeader->Type)
|
||||
{
|
||||
case ACPI_PMTT_TYPE_SOCKET:
|
||||
@@ -962,7 +965,7 @@ DtCompilePmtt (
|
||||
|
||||
PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
|
||||
(Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
|
||||
- DomainCount = PmttController->DomainCount;
|
||||
+ DomainCount = AcpiUtReadUint16(&PmttController->DomainCount);
|
||||
|
||||
while (DomainCount)
|
||||
{
|
33
0035-Support-SLIC-and-MSDM-in-a-big-endian-world.patch
Normal file
33
0035-Support-SLIC-and-MSDM-in-a-big-endian-world.patch
Normal file
@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1,22 +1,22 @@
|
||||
From 0fecc447cd64bf9da3345b2912e41e6005eb1011 Mon Sep 17 00:00:00 2001
|
||||
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 33/40] Support MCFG in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -769,11 +769,12 @@ AcpiDmDumpMcfg (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -26,7 +26,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -782,17 +783,17 @@ AcpiDmDumpMcfg (
|
||||
@@ -943,17 +944,17 @@ AcpiDmDumpMcfg (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
|
@ -1,96 +0,0 @@
|
||||
From 49b3d77990241c7216412d78e52cf15b3aa6d1ad Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Wed, 30 Sep 2020 18:18:07 -0600
|
||||
Subject: [PATCH 37/40] Support IVRS in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump2.c | 25 ++++++++++++++-----------
|
||||
1 file changed, 14 insertions(+), 11 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -353,11 +353,13 @@ 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;
|
||||
@@ -366,13 +368,14 @@ AcpiDmDumpIvrs (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
|
||||
- while (Offset < Table->Length)
|
||||
+ while (Offset < TableLength)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
||||
- Subtable->Length, AcpiDmTableInfoIvrsHdr);
|
||||
+ SubtableLength = AcpiUtReadUint16(&Subtable->Length);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, AcpiDmTableInfoIvrsHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -404,7 +407,7 @@ AcpiDmDumpIvrs (
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
- if (!Subtable->Length)
|
||||
+ if (!SubtableLength)
|
||||
{
|
||||
AcpiOsPrintf ("Invalid zero length subtable\n");
|
||||
return;
|
||||
@@ -415,8 +418,8 @@ AcpiDmDumpIvrs (
|
||||
/* Dump the subtable */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
||||
- Subtable->Length, InfoTable);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
||||
+ SubtableLength, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -442,7 +445,7 @@ AcpiDmDumpIvrs (
|
||||
sizeof (ACPI_IVRS_HARDWARE2));
|
||||
}
|
||||
|
||||
- while (EntryOffset < (Offset + Subtable->Length))
|
||||
+ while (EntryOffset < (Offset + SubtableLength))
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
/*
|
||||
@@ -504,7 +507,7 @@ AcpiDmDumpIvrs (
|
||||
|
||||
/* Dump the Device Entry */
|
||||
|
||||
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
|
||||
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
|
||||
DeviceEntry, EntryLength, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -520,8 +523,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);
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
From b521edcfceab513a900a000aa462d7f86b65a040 Mon Sep 17 00:00:00 2001
|
||||
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 34/40] Support LPIT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -534,7 +534,7 @@ AcpiDmDumpLpit (
|
||||
--- 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 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubtableLength;
|
||||
@@ -543,11 +543,11 @@ AcpiDmDumpLpit (
|
||||
@@ -699,11 +699,11 @@ AcpiDmDumpLpit (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
|
||||
@ -35,7 +35,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -571,7 +571,7 @@ AcpiDmDumpLpit (
|
||||
@@ -727,7 +727,7 @@ AcpiDmDumpLpit (
|
||||
return;
|
||||
}
|
||||
|
85
0038-Support-PMTT-in-a-big-endian-world.patch
Normal file
85
0038-Support-PMTT-in-a-big-endian-world.patch
Normal file
@ -0,0 +1,85 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1,61 +0,0 @@
|
||||
From 9d7f9c8f4ecbee2e621d471a8c4944cebe62947d Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Wed, 30 Sep 2020 18:59:57 -0600
|
||||
Subject: [PATCH 1/5] Add partial big-endian support for WPBT tables
|
||||
|
||||
There's some weirdness here that at present does not warrant
|
||||
further investigation; this is just a really low priority table.
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/common/dmtbdump3.c | 8 ++++----
|
||||
source/compiler/dttable2.c | 3 ++-
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -628,13 +628,13 @@ AcpiDmDumpWpbt (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_TABLE_WPBT *Subtable;
|
||||
- UINT32 Length = Table->Length;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
UINT16 ArgumentsLength;
|
||||
|
||||
|
||||
/* Dump the main table */
|
||||
|
||||
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoWpbt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -643,10 +643,10 @@ AcpiDmDumpWpbt (
|
||||
/* Extract the arguments buffer length from the main table */
|
||||
|
||||
Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
|
||||
- ArgumentsLength = Subtable->ArgumentsLength;
|
||||
+ ArgumentsLength = AcpiUtReadUint16(&Subtable->ArgumentsLength);
|
||||
|
||||
/* Dump the arguments buffer */
|
||||
|
||||
- (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
|
||||
+ (void) AcpiDmDumpTable (TableLength, 0, Table, ArgumentsLength,
|
||||
AcpiDmTableInfoWpbt0);
|
||||
}
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -2190,7 +2190,8 @@ DtCompileWpbt (
|
||||
|
||||
/* Extract the length of the Arguments buffer, insert into main table */
|
||||
|
||||
- Length = (UINT16) Subtable->TotalLength;
|
||||
+ AcpiUtWriteUint(&Length, sizeof(UINT16),
|
||||
+ &Subtable->TotalLength, sizeof(UINT32));
|
||||
Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
|
||||
Table->ArgumentsLength = Length;
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 1e1129d788087025cf31b0c3babdb9bca01f1c4e Mon Sep 17 00:00:00 2001
|
||||
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 38/40] Support TPM2 in a big-endian world
|
||||
Subject: [PATCH 39/45] Support TPM2 in a big-endian world
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
@ -9,15 +9,15 @@ Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
source/compiler/dttable2.c | 8 +++++---
|
||||
2 files changed, 15 insertions(+), 11 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -409,11 +409,12 @@ AcpiDmDumpTpm2Rev3 (
|
||||
--- 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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -27,7 +27,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -425,8 +426,8 @@ AcpiDmDumpTpm2Rev3 (
|
||||
@@ -486,8 +487,8 @@ AcpiDmDumpTpm2Rev3 (
|
||||
{
|
||||
case ACPI_TPM23_ACPI_START_METHOD:
|
||||
|
||||
@ -38,15 +38,15 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -456,6 +457,7 @@ AcpiDmDumpTpm2 (
|
||||
@@ -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);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
if (Table->Revision == 3)
|
||||
@@ -466,7 +468,7 @@ AcpiDmDumpTpm2 (
|
||||
@@ -527,7 +529,7 @@ AcpiDmDumpTpm2 (
|
||||
|
||||
/* Main table */
|
||||
|
||||
@ -55,7 +55,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -474,8 +476,8 @@ AcpiDmDumpTpm2 (
|
||||
@@ -535,8 +537,8 @@ AcpiDmDumpTpm2 (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -66,7 +66,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -490,8 +492,8 @@ AcpiDmDumpTpm2 (
|
||||
@@ -551,8 +553,8 @@ AcpiDmDumpTpm2 (
|
||||
Offset += sizeof (ACPI_TPM2_TRAILER);
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -77,11 +77,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
break;
|
||||
|
||||
default:
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1904,6 +1904,7 @@ DtCompileTpm2 (
|
||||
--- 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;
|
||||
@ -89,17 +89,17 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
@@ -1947,7 +1948,8 @@ DtCompileTpm2 (
|
||||
@@ -2310,7 +2311,8 @@ DtCompileTpm2 (
|
||||
|
||||
/* Subtable type depends on the StartMethod */
|
||||
|
||||
- switch (Tpm2Header->StartMethod)
|
||||
+ StartMethod = *(UINT8 *)&Tpm2Header->StartMethod;
|
||||
+ StartMethod = *(UINT8 *) &Tpm2Header->StartMethod;
|
||||
+ switch (StartMethod)
|
||||
{
|
||||
case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
|
||||
|
||||
@@ -1978,7 +1980,7 @@ DtCompileTpm2 (
|
||||
@@ -2341,7 +2343,7 @@ DtCompileTpm2 (
|
||||
case ACPI_TPM2_RESERVED10:
|
||||
|
||||
AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n",
|
||||
@ -108,7 +108,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Status = AE_ERROR;
|
||||
break;
|
||||
|
||||
@@ -1986,7 +1988,7 @@ DtCompileTpm2 (
|
||||
@@ -2349,7 +2351,7 @@ DtCompileTpm2 (
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n",
|
@ -1,27 +1,27 @@
|
||||
From 5805d42c0cec5366daa12e0f4caed7a58b13fe5b Mon Sep 17 00:00:00 2001
|
||||
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 5/5] Support S3PT in a big-endian world
|
||||
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-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1809,6 +1809,8 @@ AcpiDmDumpS3pt (
|
||||
--- 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);
|
||||
+ UINT32 S3ptTableLength = AcpiUtReadUint32 (&S3ptTable->Length);
|
||||
+ UINT16 SubtableType;
|
||||
|
||||
|
||||
/* Main table */
|
||||
@@ -1820,19 +1822,20 @@ AcpiDmDumpS3pt (
|
||||
@@ -2050,19 +2052,20 @@ AcpiDmDumpS3pt (
|
||||
}
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
|
||||
@ -40,12 +40,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
}
|
||||
|
||||
- switch (Subtable->Type)
|
||||
+ SubtableType = AcpiUtReadUint16(&Subtable->Type);
|
||||
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
|
||||
+ switch (SubtableType)
|
||||
{
|
||||
case ACPI_S3PT_TYPE_RESUME:
|
||||
|
||||
@@ -1847,7 +1850,7 @@ AcpiDmDumpS3pt (
|
||||
@@ -2077,7 +2080,7 @@ AcpiDmDumpS3pt (
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
|
||||
@ -54,7 +54,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -1860,7 +1863,7 @@ AcpiDmDumpS3pt (
|
||||
@@ -2090,7 +2093,7 @@ AcpiDmDumpS3pt (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -63,7 +63,7 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Subtable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1874,7 +1877,7 @@ NextSubtable:
|
||||
@@ -2104,7 +2107,7 @@ NextSubtable:
|
||||
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length);
|
||||
}
|
||||
|
||||
@ -72,11 +72,11 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
}
|
||||
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
@@ -1188,6 +1188,7 @@ DtCompileS3pt (
|
||||
--- 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;
|
||||
@ -84,12 +84,12 @@ Index: acpica-unix2-20200925/source/compiler/dttable2.c
|
||||
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
|
||||
@@ -1215,7 +1216,8 @@ DtCompileS3pt (
|
||||
@@ -1433,7 +1434,8 @@ DtCompileS3pt (
|
||||
|
||||
S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
|
||||
|
||||
- switch (S3ptHeader->Type)
|
||||
+ S3ptHeaderType = AcpiUtReadUint16(&S3ptHeader->Type);
|
||||
+ S3ptHeaderType = AcpiUtReadUint16 (&S3ptHeader->Type);
|
||||
+ switch (S3ptHeaderType)
|
||||
{
|
||||
case ACPI_S3PT_TYPE_RESUME:
|
@ -1,20 +1,20 @@
|
||||
From 88d16feb9d6982cc9c09f2ae9b76b26f0d9c96e0 Mon Sep 17 00:00:00 2001
|
||||
From 5bd43bca1708a56d32e63da0278e04caf2865927 Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Wed, 30 Sep 2020 17:48:04 -0600
|
||||
Subject: [PATCH 36/40] Support IORT in a big-endian world
|
||||
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 | 73 ++++++++++++++++++++++----------------
|
||||
source/compiler/dttable1.c | 37 ++++++++++---------
|
||||
2 files changed, 64 insertions(+), 46 deletions(-)
|
||||
source/common/dmtbdump2.c | 85 ++++++++++++++++++++++----------------
|
||||
source/compiler/dttable1.c | 40 ++++++++++--------
|
||||
2 files changed, 72 insertions(+), 53 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -75,16 +75,19 @@ AcpiDmDumpIort (
|
||||
ACPI_IORT_SMMU *IortSmmu = NULL;
|
||||
--- 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;
|
||||
@ -23,8 +23,9 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
char *String;
|
||||
UINT32 i;
|
||||
UINT32 MappingByteLength;
|
||||
UINT8 Revision;
|
||||
+ UINT32 MappingCount;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -34,12 +35,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -95,25 +98,26 @@ AcpiDmDumpIort (
|
||||
@@ -109,18 +112,19 @@ AcpiDmDumpIort (
|
||||
|
||||
/* Dump the OptionalPadding (optional) */
|
||||
|
||||
- if (Iort->NodeOffset > Offset)
|
||||
+ NodeOffset = AcpiUtReadUint32(&Iort->NodeOffset);
|
||||
+ NodeOffset = AcpiUtReadUint32 (&Iort->NodeOffset);
|
||||
+ if (NodeOffset > Offset)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset, Table,
|
||||
@ -54,54 +55,68 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
|
||||
- Offset = Iort->NodeOffset;
|
||||
- while (Offset < Table->Length)
|
||||
+ Offset = AcpiUtReadUint32(&Iort->NodeOffset);
|
||||
+ Offset = AcpiUtReadUint32 (&Iort->NodeOffset);
|
||||
+ while (Offset < TableLength)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset);
|
||||
AcpiOsPrintf ("\n");
|
||||
Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
|
||||
@@ -130,12 +134,12 @@ AcpiDmDumpIort (
|
||||
|
||||
if (Revision == 0)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
||||
IortNode, Length, AcpiDmTableInfoIortHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
}
|
||||
else if (Revision >= 3)
|
||||
{
|
||||
@@ -142,7 +146,7 @@ AcpiDmDumpIort (
|
||||
- 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;
|
||||
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
||||
break;
|
||||
|
||||
case ACPI_IORT_NODE_SMMU:
|
||||
@@ -155,13 +159,13 @@ AcpiDmDumpIort (
|
||||
@@ -179,19 +183,19 @@ AcpiDmDumpIort (
|
||||
case ACPI_IORT_NODE_SMMU_V3:
|
||||
|
||||
InfoTable = AcpiDmTableInfoIort4;
|
||||
- Length = IortNode->Length - NodeOffset;
|
||||
+ Length = AcpiUtReadUint16(&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;
|
||||
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -171,7 +175,7 @@ AcpiDmDumpIort (
|
||||
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))
|
||||
+ if (!AcpiUtReadUint16 (&IortNode->Length))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid zero length IORT node\n");
|
||||
return;
|
||||
@@ -182,7 +186,7 @@ AcpiDmDumpIort (
|
||||
@@ -213,7 +217,7 @@ AcpiDmDumpIort (
|
||||
/* Dump the node subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -110,13 +125,12 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -202,9 +206,11 @@ AcpiDmDumpIort (
|
||||
@@ -233,9 +237,10 @@ AcpiDmDumpIort (
|
||||
|
||||
if (IortItsGroup)
|
||||
{
|
||||
- for (i = 0; i < IortItsGroup->ItsCount; i++)
|
||||
+ UINT32 ItsCount = AcpiUtReadUint32(&IortItsGroup->ItsCount);
|
||||
+
|
||||
+ UINT32 ItsCount = AcpiUtReadUint32 (&IortItsGroup->ItsCount);
|
||||
+ for (i = 0; i < ItsCount; i++)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
||||
@ -124,26 +138,26 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
4, AcpiDmTableInfoIort0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -221,12 +227,14 @@ AcpiDmDumpIort (
|
||||
@@ -252,12 +257,14 @@ AcpiDmDumpIort (
|
||||
|
||||
/* Dump the Padding (optional) */
|
||||
|
||||
- if (IortNode->Length > NodeOffset)
|
||||
+ NodeLength = AcpiUtReadUint16(&IortNode->Length);
|
||||
+ 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) *
|
||||
+ AcpiUtReadUint32 (&IortNode->MappingCount) *
|
||||
+ sizeof (ACPI_IORT_ID_MAPPING);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
||||
+ Table, NodeLength - NodeOffset - MappingByteLength,
|
||||
AcpiDmTableInfoIort1a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -243,9 +251,11 @@ AcpiDmDumpIort (
|
||||
@@ -274,9 +281,11 @@ AcpiDmDumpIort (
|
||||
|
||||
if (IortSmmu)
|
||||
{
|
||||
@ -152,19 +166,19 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
Length = 2 * sizeof (UINT64);
|
||||
- NodeOffset = IortSmmu->GlobalInterruptOffset;
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
||||
+ NodeOffset = AcpiUtReadUint32(&IortSmmu->GlobalInterruptOffset);
|
||||
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->GlobalInterruptOffset);
|
||||
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
Length, AcpiDmTableInfoIort3a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -253,10 +263,11 @@ AcpiDmDumpIort (
|
||||
@@ -284,10 +293,11 @@ AcpiDmDumpIort (
|
||||
return;
|
||||
}
|
||||
|
||||
- NodeOffset = IortSmmu->ContextInterruptOffset;
|
||||
- for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
|
||||
+ NodeOffset = AcpiUtReadUint32(&IortSmmu->ContextInterruptOffset);
|
||||
+ InterruptCount = AcpiUtReadUint32(&IortSmmu->ContextInterruptCount);
|
||||
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->ContextInterruptOffset);
|
||||
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->ContextInterruptCount);
|
||||
+ for (i = 0; i < InterruptCount; i++)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
||||
@ -172,14 +186,14 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
8, AcpiDmTableInfoIort3b);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -267,10 +278,11 @@ AcpiDmDumpIort (
|
||||
@@ -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);
|
||||
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->PmuInterruptOffset);
|
||||
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->PmuInterruptCount);
|
||||
+ for (i = 0; i < InterruptCount; i++)
|
||||
{
|
||||
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
||||
@ -187,14 +201,33 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
8, AcpiDmTableInfoIort3c);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -290,12 +302,13 @@ AcpiDmDumpIort (
|
||||
@@ -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);
|
||||
+ NodeOffset = AcpiUtReadUint32 (&IortNode->MappingOffset);
|
||||
+ MappingCount = AcpiUtReadUint32 (&IortNode->MappingCount);
|
||||
+ for (i = 0; i < MappingCount; i++)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -204,28 +237,28 @@ Index: acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
||||
Length, AcpiDmTableInfoIortMap);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -309,7 +322,7 @@ AcpiDmDumpIort (
|
||||
@@ -363,7 +378,7 @@ AcpiDmDumpIort (
|
||||
NextSubtable:
|
||||
/* Point to next node subtable */
|
||||
|
||||
- Offset += IortNode->Length;
|
||||
+ Offset += AcpiUtReadUint16(&IortNode->Length);
|
||||
+ Offset += AcpiUtReadUint16 (&IortNode->Length);
|
||||
}
|
||||
}
|
||||
|
||||
Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
|
||||
+++ acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
@@ -1516,6 +1516,7 @@ DtCompileIort (
|
||||
ACPI_IORT_NODE *IortNode;
|
||||
--- 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;
|
||||
@@ -1548,7 +1549,7 @@ DtCompileIort (
|
||||
@@ -1637,7 +1638,7 @@ DtCompileIort (
|
||||
* Optionally allows the generic data types to be used for filling
|
||||
* this field.
|
||||
*/
|
||||
@ -234,7 +267,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
|
||||
&Subtable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1558,7 +1559,7 @@ DtCompileIort (
|
||||
@@ -1647,7 +1648,7 @@ DtCompileIort (
|
||||
if (Subtable)
|
||||
{
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
@ -243,27 +276,25 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1568,8 +1569,9 @@ DtCompileIort (
|
||||
@@ -1657,7 +1658,7 @@ DtCompileIort (
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
- Iort->NodeOffset += PaddingLength;
|
||||
+ IortNodeOffset += PaddingLength;
|
||||
}
|
||||
+ Iort->NodeOffset = AcpiUtReadUint32(&IortNodeOffset);
|
||||
|
||||
NodeNumber = 0;
|
||||
while (*PFieldList)
|
||||
@@ -1623,7 +1625,7 @@ DtCompileIort (
|
||||
@@ -1721,7 +1722,7 @@ DtCompileIort (
|
||||
ItsNumber++;
|
||||
}
|
||||
|
||||
- IortItsGroup->ItsCount = ItsNumber;
|
||||
+ IortItsGroup->ItsCount = AcpiUtReadUint32(&ItsNumber);
|
||||
+ IortItsGroup->ItsCount = AcpiUtReadUint32 (&ItsNumber);
|
||||
break;
|
||||
|
||||
case ACPI_IORT_NODE_NAMED_COMPONENT:
|
||||
@@ -1657,15 +1659,18 @@ DtCompileIort (
|
||||
@@ -1755,15 +1756,18 @@ DtCompileIort (
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -285,7 +316,7 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
&Subtable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -1673,7 +1678,7 @@ DtCompileIort (
|
||||
@@ -1771,7 +1775,7 @@ DtCompileIort (
|
||||
}
|
||||
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
@ -294,72 +325,90 @@ Index: acpica-unix2-20200925/source/compiler/dttable1.c
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1706,7 +1711,7 @@ DtCompileIort (
|
||||
@@ -1804,7 +1808,7 @@ DtCompileIort (
|
||||
|
||||
/* Compile global interrupt array */
|
||||
|
||||
- IortSmmu->GlobalInterruptOffset = NodeLength;
|
||||
+ IortSmmu->GlobalInterruptOffset = AcpiUtReadUint32(&NodeLength);
|
||||
+ IortSmmu->GlobalInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
|
||||
&Subtable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -1720,7 +1725,7 @@ DtCompileIort (
|
||||
@@ -1818,7 +1822,7 @@ DtCompileIort (
|
||||
/* Compile context interrupt array */
|
||||
|
||||
ContextIrptNumber = 0;
|
||||
- IortSmmu->ContextInterruptOffset = NodeLength;
|
||||
+ IortSmmu->ContextInterruptOffset = AcpiUtReadUint32(&NodeLength);
|
||||
+ IortSmmu->ContextInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
||||
while (*PFieldList)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
|
||||
@@ -1740,12 +1745,12 @@ DtCompileIort (
|
||||
@@ -1838,12 +1842,12 @@ DtCompileIort (
|
||||
ContextIrptNumber++;
|
||||
}
|
||||
|
||||
- IortSmmu->ContextInterruptCount = ContextIrptNumber;
|
||||
+ IortSmmu->ContextInterruptCount = AcpiUtReadUint32(&ContextIrptNumber);
|
||||
+ IortSmmu->ContextInterruptCount = AcpiUtReadUint32 (&ContextIrptNumber);
|
||||
|
||||
/* Compile PMU interrupt array */
|
||||
|
||||
PmuIrptNumber = 0;
|
||||
- IortSmmu->PmuInterruptOffset = NodeLength;
|
||||
+ IortSmmu->PmuInterruptOffset = AcpiUtReadUint32(&NodeLength);
|
||||
+ IortSmmu->PmuInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
||||
while (*PFieldList)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
|
||||
@@ -1765,7 +1770,7 @@ DtCompileIort (
|
||||
@@ -1863,7 +1867,7 @@ DtCompileIort (
|
||||
PmuIrptNumber++;
|
||||
}
|
||||
|
||||
- IortSmmu->PmuInterruptCount = PmuIrptNumber;
|
||||
+ IortSmmu->PmuInterruptCount = AcpiUtReadUint32(&PmuIrptNumber);
|
||||
+ IortSmmu->PmuInterruptCount = AcpiUtReadUint32 (&PmuIrptNumber);
|
||||
break;
|
||||
|
||||
case ACPI_IORT_NODE_SMMU_V3:
|
||||
@@ -1802,7 +1807,7 @@ DtCompileIort (
|
||||
@@ -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);
|
||||
+ IortNode->MappingOffset = AcpiUtReadUint32 (&NodeLength);
|
||||
IdMappingNumber = 0;
|
||||
while (*PFieldList)
|
||||
{
|
||||
@@ -1823,7 +1828,7 @@ DtCompileIort (
|
||||
@@ -1960,7 +1964,7 @@ DtCompileIort (
|
||||
IdMappingNumber++;
|
||||
}
|
||||
|
||||
- IortNode->MappingCount = IdMappingNumber;
|
||||
+ IortNode->MappingCount = AcpiUtReadUint32(&IdMappingNumber);
|
||||
+ IortNode->MappingCount = AcpiUtReadUint32 (&IdMappingNumber);
|
||||
if (!IdMappingNumber)
|
||||
{
|
||||
IortNode->MappingOffset = 0;
|
||||
@@ -1838,7 +1843,7 @@ DtCompileIort (
|
||||
@@ -1975,7 +1979,7 @@ DtCompileIort (
|
||||
NodeNumber++;
|
||||
}
|
||||
|
||||
- Iort->NodeCount = NodeNumber;
|
||||
+ Iort->NodeCount = AcpiUtReadUint32(&NodeNumber);
|
||||
+ Iort->NodeCount = AcpiUtReadUint32 (&NodeNumber);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 62c6c5b94772b7f8f5de6136a2ba61e31d0c7b3c Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Fri, 16 Oct 2020 20:52:43 -0400
|
||||
Subject: [PATCH 3/5] Support MTMR 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-20200925/source/common/dmtbdump2.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
|
||||
@@ -1048,11 +1048,12 @@ AcpiDmDumpMtmr (
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_MTMR);
|
||||
ACPI_MTMR_ENTRY *Subtable;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoMtmr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -1061,12 +1062,12 @@ AcpiDmDumpMtmr (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_MTMR_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_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
138
0042-Support-IVRS-in-a-big-endian-world.patch
Normal file
138
0042-Support-IVRS-in-a-big-endian-world.patch
Normal file
@ -0,0 +1,138 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
From 19eefeadf92a471f1c4fbc6dd4d035e45fa76dcd Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Mon, 19 Oct 2020 17:17:40 -0400
|
||||
Subject: [PATCH 4/5] Support VRTC in a big-endian world
|
||||
|
||||
---
|
||||
source/common/dmtbdump3.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
|
||||
@@ -521,11 +521,12 @@ AcpiDmDumpVrtc (
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_VRTC);
|
||||
ACPI_VRTC_ENTRY *Subtable;
|
||||
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
|
||||
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoVrtc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@@ -534,12 +535,12 @@ AcpiDmDumpVrtc (
|
||||
/* Subtables */
|
||||
|
||||
Subtable = ACPI_ADD_PTR (ACPI_VRTC_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_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
File diff suppressed because it is too large
Load Diff
23
0044-Initial-support-for-WPBT-in-big-endian-needs-more.patch
Normal file
23
0044-Initial-support-for-WPBT-in-big-endian-needs-more.patch
Normal file
@ -0,0 +1,23 @@
|
||||
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);
|
213
0045-CSRT-fixed-use-of-optional-ResourceInfo.patch
Normal file
213
0045-CSRT-fixed-use-of-optional-ResourceInfo.patch
Normal file
@ -0,0 +1,213 @@
|
||||
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 ();
|
@ -1,86 +0,0 @@
|
||||
From e942e785b3ec47693029e3841075becba31f2635 Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Wed, 28 Oct 2020 12:53:34 -0600
|
||||
Subject: [PATCH] Correct a couple of endianness issues previously unseen
|
||||
|
||||
Just odds and ends of some resource types and ASL analysis
|
||||
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
---
|
||||
source/compiler/aslanalyze.c | 4 ++--
|
||||
source/compiler/aslrestype1.c | 16 ++++++++--------
|
||||
source/compiler/aslrestype1i.c | 2 +-
|
||||
3 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
|
||||
index 63feba2b1..f76a8c3cd 100644
|
||||
--- a/source/compiler/aslanalyze.c
|
||||
+++ b/source/compiler/aslanalyze.c
|
||||
@@ -577,7 +577,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;
|
||||
|
||||
/*
|
||||
@@ -604,7 +604,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") */
|
||||
|
||||
diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c
|
||||
index e7639c0bb..fd4428aab 100644
|
||||
--- a/source/compiler/aslrestype1.c
|
||||
+++ b/source/compiler/aslrestype1.c
|
||||
@@ -328,10 +328,10 @@ RsDoMemory24Descriptor (
|
||||
/* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
|
||||
|
||||
RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
|
||||
- Descriptor->Memory24.Minimum,
|
||||
- Descriptor->Memory24.Maximum,
|
||||
- Descriptor->Memory24.AddressLength,
|
||||
- Descriptor->Memory24.Alignment,
|
||||
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Minimum),
|
||||
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Maximum),
|
||||
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.AddressLength),
|
||||
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Alignment),
|
||||
MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
|
||||
|
||||
return (Rnode);
|
||||
@@ -442,10 +442,10 @@ RsDoMemory32Descriptor (
|
||||
/* Validate the Min/Max/Len/Align values */
|
||||
|
||||
RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
|
||||
- Descriptor->Memory32.Minimum,
|
||||
- Descriptor->Memory32.Maximum,
|
||||
- Descriptor->Memory32.AddressLength,
|
||||
- Descriptor->Memory32.Alignment,
|
||||
+ AcpiUtReadUint32(&Descriptor->Memory32.Minimum),
|
||||
+ AcpiUtReadUint32(&Descriptor->Memory32.Maximum),
|
||||
+ AcpiUtReadUint32(&Descriptor->Memory32.AddressLength),
|
||||
+ AcpiUtReadUint32(&Descriptor->Memory32.Alignment),
|
||||
MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
|
||||
|
||||
return (Rnode);
|
||||
diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c
|
||||
index 532553c4b..d41e3a1e8 100644
|
||||
--- a/source/compiler/aslrestype1i.c
|
||||
+++ b/source/compiler/aslrestype1i.c
|
||||
@@ -436,7 +436,7 @@ RsDoFixedIoDescriptor (
|
||||
|
||||
/* Error checks */
|
||||
|
||||
- if (Descriptor->FixedIo.Address > 0x03FF)
|
||||
+ if (AcpiUtReadUint16(&Descriptor->FixedIo.Address) > 0x03FF)
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_ISA_ADDRESS, AddressOp, NULL);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
@ -28,47 +28,47 @@ 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-Support-MADT-aka-APIC-in-a-big-endian-world.patch
|
||||
Patch5: 0006-Support-ASF-tables-in-a-big-endian-world.patch
|
||||
Patch6: 0007-Support-CPEP-tables-in-a-big-endian-world.patch
|
||||
Patch7: 0008-Support-DBG2-table-in-a-big-endian-world.patch
|
||||
Patch8: 0009-Support-DMAR-in-a-big-endian-world.patch
|
||||
Patch9: 0010-Support-DRTM-in-a-big-endian-world.patch
|
||||
Patch10: 0011-Support-EINJ-in-a-big-endian-world.patch
|
||||
Patch11: 0012-Support-ERST-in-a-big-endian-world.patch
|
||||
Patch12: 0013-Support-FADT-aka-FACP-in-a-big-endian-world.patch
|
||||
Patch13: 0014-Support-most-FPDTs-in-a-big-endian-world.patch
|
||||
Patch14: 0015-Support-GTDT-in-a-big-endian-world.patch
|
||||
Patch15: 0016-Support-HEST-in-a-big-endian-world.patch
|
||||
Patch16: 0017-Support-RSDT-RSD-PTR-in-a-big-endian-world.patch
|
||||
Patch17: 0018-Support-XSDT-in-a-big-endian-world.patch
|
||||
Patch18: 0019-Support-SRAT-in-a-big-endian-world.patch
|
||||
Patch19: 0020-Support-SLIT-in-a-big-endian-world.patch
|
||||
Patch20: 0021-Support-MSCT-in-a-big-endian-world.patch
|
||||
Patch21: 0022-Support-MPST-in-a-big-endian-world.patch
|
||||
Patch22: 0023-Support-NFIT-in-a-big-endian-world.patch
|
||||
Patch23: 0024-Support-SDEV-in-a-big-endian-world.patch
|
||||
Patch24: 0025-Support-HMAT-in-a-big-endian-world.patch
|
||||
Patch25: 0026-Support-PDTT-in-a-big-endian-world.patch
|
||||
Patch26: 0027-Support-PPTT-in-a-big-endian-world.patch
|
||||
Patch27: 0028-Support-PCCT-in-a-big-endian-world.patch
|
||||
Patch28: 0029-Support-WDAT-in-a-big-endian-world.patch
|
||||
Patch29: 0030-Support-TCPA-in-a-big-endian-world.patch
|
||||
Patch30: 0031-Support-STAO-in-a-big-endian-world.patch
|
||||
Patch31: 0032-Support-SLIC-and-MSDM-in-a-big-endian-world.patch
|
||||
Patch32: 0033-Support-MCFG-in-a-big-endian-world.patch
|
||||
Patch33: 0034-Support-LPIT-in-a-big-endian-world.patch
|
||||
Patch34: 0035-Support-PMTT-in-a-big-endian-world.patch
|
||||
Patch35: 0036-Support-IORT-in-a-big-endian-world.patch
|
||||
Patch36: 0037-Support-IVRS-in-a-big-endian-world.patch
|
||||
Patch37: 0038-Support-TPM2-in-a-big-endian-world.patch
|
||||
Patch38: 0039-Add-partial-big-endian-support-for-WPBT-tables.patch
|
||||
Patch39: 0040-Support-DSDT-SSDT-in-a-big-endian-world.patch
|
||||
Patch40: 0041-Support-MTMR-in-a-big-endian-world.patch
|
||||
Patch41: 0042-Support-VRTC-in-a-big-endian-world.patch
|
||||
Patch42: 0043-Support-S3PT-in-a-big-endian-world.patch
|
||||
Patch43: 0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch
|
||||
Patch44: 0045-Correct-a-couple-of-endianness-issues-previously-uns.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
|
||||
|
||||
# other miscellaneous patches
|
||||
Patch100: unaligned.patch
|
||||
@ -253,11 +253,12 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Jul 7 2021 Al Stone <ahs3@redhat.com> - 20210604-1
|
||||
* Sun Jul 11 2021 Al Stone <ahs3@redhat.com> - 20210604-1
|
||||
- Update to 20210604 source tree (please note that tarballs for versions
|
||||
between 20200925 and 20210604 have been uploaded for archival reasons
|
||||
but no packaged version of these has been commited to the Fedora project)
|
||||
- Bring the big-endian patches up-to-date.
|
||||
- Bring the big-endian patches up-to-date with what has been submitted
|
||||
upstream (not accepted currently).
|
||||
|
||||
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20200925-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
10
arm7hl.patch
10
arm7hl.patch
@ -1,8 +1,8 @@
|
||||
Index: acpica-unix2-20200925/source/include/acmacros.h
|
||||
Index: acpica-unix2-20210604/source/include/acmacros.h
|
||||
===================================================================
|
||||
--- acpica-unix2-20200925.orig/source/include/acmacros.h
|
||||
+++ acpica-unix2-20200925/source/include/acmacros.h
|
||||
@@ -163,6 +163,8 @@
|
||||
--- acpica-unix2-20210604.orig/source/include/acmacros.h
|
||||
+++ acpica-unix2-20210604/source/include/acmacros.h
|
||||
@@ -108,6 +108,8 @@
|
||||
|
||||
/* 16-bit source, 16/32/64 destination */
|
||||
|
||||
@ -11,7 +11,7 @@ Index: acpica-unix2-20200925/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];}
|
||||
|
||||
@@ -182,6 +184,7 @@
|
||||
@@ -127,6 +129,7 @@
|
||||
|
||||
/* 64-bit source, 16/32/64 destination */
|
||||
|
||||
|
@ -256,7 +256,7 @@ Warning 3144 - ^ Method Local is set but never used
|
||||
|
||||
Intel ACPI Component Architecture
|
||||
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
|
||||
Copyright (c) 2000 - 2020 Intel Corporation
|
||||
Copyright (c) 2000 - 2021 Intel Corporation
|
||||
|
||||
Ignoring all errors, forcing AML file generation
|
||||
|
||||
|
@ -31,7 +31,7 @@ Remark 2158 - ^ Unnecessary/redundant use of Offset
|
||||
|
||||
Intel ACPI Component Architecture
|
||||
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
|
||||
Copyright (c) 2000 - 2020 Intel Corporation
|
||||
Copyright (c) 2000 - 2021 Intel Corporation
|
||||
|
||||
Ignoring all errors, forcing AML file generation
|
||||
|
||||
|
@ -580,7 +580,7 @@ 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 - 2020 Intel Corporation
|
||||
Copyright (c) 2000 - 2021 Intel Corporation
|
||||
|
||||
Ignoring all errors, forcing AML file generation
|
||||
|
||||
|
@ -14,8 +14,8 @@ Index: acpica-unix2-20200925/source/compiler/aslanalyze.c
|
||||
"Method returns [%s], %s operator requires [%s]",
|
||||
AslGbl_StringBuffer, OpInfo->Name, AslGbl_StringBuffer2);
|
||||
|
||||
- AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer);
|
||||
+ AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, strp);
|
||||
- AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer);
|
||||
+ AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, strp);
|
||||
+ if (cnt > 0)
|
||||
+ free(strp);
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
diff -Naur acpica-unix2-20200925.orig/source/common/dmtbdump.c acpica-unix2-20200925/source/common/dmtbdump.c
|
||||
--- acpica-unix2-20200925.orig/source/common/dmtbdump.c 2020-10-27 08:50:34.949398104 -0500
|
||||
+++ acpica-unix2-20200925/source/common/dmtbdump.c 2020-10-27 08:54:27.609955141 -0500
|
||||
@@ -333,7 +333,11 @@
|
||||
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]));
|
||||
+ AcpiOsPrintf ("%16.16llX\n", AcpiUtReadUint64 (&Array[i]));
|
||||
+#else
|
||||
AcpiOsPrintf ("%16.16lX\n", AcpiUtReadUint64(&Array[i]));
|
||||
AcpiOsPrintf ("%16.16lX\n", AcpiUtReadUint64 (&Array[i]));
|
||||
+#endif
|
||||
Offset += sizeof (UINT64);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user