Blame 0044-Correct-an-endian-ness-problem-when-converting-ASL-t.patch

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