Blame SOURCES/0005-Correct-an-endian-ness-problem-when-converting-ASL-t.patch

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