From c6ecf612fe865089147297d1ad62345030147601 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 27 Oct 2020 17:54:15 -0600 Subject: [PATCH] Add a patch to correct for endianness when converting ASL to ASL+ Signed-off-by: Al Stone --- ...n-ness-problem-when-converting-ASL-t.patch | 43 +++++++++++++++++++ acpica-tools.spec | 2 + 2 files changed, 45 insertions(+) create mode 100644 0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch diff --git a/0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch b/0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch new file mode 100644 index 0000000..5d7da5b --- /dev/null +++ b/0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch @@ -0,0 +1,43 @@ +From 9dc82e99776b18fe19314695d7d83e79c7fea934 Mon Sep 17 00:00:00 2001 +From: Al Stone +Date: Tue, 27 Oct 2020 17:50:52 -0600 +Subject: [PATCH] Correct an endian-ness problem when converting ASL to ASL+ + +Signed-off-by: Al Stone +--- + 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 +@@ -144,6 +144,7 @@ CvInitFileTree ( + char *ChildFilename = NULL; + UINT8 *AmlStart; + UINT32 AmlLength; ++ UINT32 TableLength = AcpiUtReadUint32(&Table->Length); + + + if (!AcpiGbl_CaptureComments) +@@ -152,7 +153,7 @@ CvInitFileTree ( + } + + +- AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER); ++ AmlLength = TableLength - sizeof (ACPI_TABLE_HEADER); + AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)); + + CvDbgPrint ("AmlLength: %x\n", AmlLength); +@@ -162,7 +163,7 @@ CvInitFileTree ( + AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache); + + AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart); +- AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length); ++ AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + TableLength); + AcpiGbl_FileTreeRoot->Next = NULL; + AcpiGbl_FileTreeRoot->Parent = NULL; + AcpiGbl_FileTreeRoot->Filename = (char *)(AmlStart+2); +-- +2.26.2 + diff --git a/acpica-tools.spec b/acpica-tools.spec index 5409cda..0dcf7e8 100644 --- a/acpica-tools.spec +++ b/acpica-tools.spec @@ -67,6 +67,7 @@ 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 # other miscellaneous patches Patch100: unaligned.patch @@ -178,6 +179,7 @@ gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f - %patch40 -p1 %patch41 -p1 %patch42 -p1 +%patch43 -p1 # apply the remaining patches %patch100 -p1