Blame SOURCES/0004-Re-enable-support-for-big-endian-machines.patch

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