1 From 16734feab4204d6930c1ede62e527920607daace Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Wed, 16 Sep 2020 16:27:06 -0600
4 Subject: [PATCH 04/45] Re-enable support for big-endian machines
6 First, disable the big-endian check and fail. Then, make sure the
7 namespace gets initialized properly (NB: needed even if we are only
8 compiling/disassembling data tables).
10 Signed-off-by: Al Stone <ahs3@redhat.com>
12 source/compiler/aslmain.c | 12 ------------
13 source/components/namespace/nsutils.c | 7 +++++--
14 2 files changed, 5 insertions(+), 14 deletions(-)
16 Index: acpica-unix2-20220331/source/compiler/aslmain.c
17 ===================================================================
18 --- acpica-unix2-20220331.orig/source/compiler/aslmain.c
19 +++ acpica-unix2-20220331/source/compiler/aslmain.c
20 @@ -101,18 +101,6 @@ main (
22 signal (SIGINT, AslSignalHandler);
25 - * Big-endian machines are not currently supported. ACPI tables must
26 - * be little-endian, and support for big-endian machines needs to
29 - if (UtIsBigEndianMachine ())
32 - "iASL is not currently supported on big-endian machines.\n");
37 ACPI_DEBUG_INITIALIZE (); /* For debug version only */
39 Index: acpica-unix2-20220331/source/components/namespace/nsutils.c
40 ===================================================================
41 --- acpica-unix2-20220331.orig/source/components/namespace/nsutils.c
42 +++ acpica-unix2-20220331/source/components/namespace/nsutils.c
43 @@ -272,6 +272,7 @@ AcpiNsBuildInternalName (
44 const char *ExternalName = Info->NextExternalChar;
47 + char TmpSeg[ACPI_NAMESEG_SIZE+1];
50 ACPI_FUNCTION_TRACE (NsBuildInternalName);
51 @@ -335,6 +336,7 @@ AcpiNsBuildInternalName (
53 for (; NumSegments; NumSegments--)
55 + memset (TmpSeg, 0, ACPI_NAMESEG_SIZE+1);
56 for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
58 if (ACPI_IS_PATH_SEPARATOR (*ExternalName) ||
59 @@ -342,16 +344,17 @@ AcpiNsBuildInternalName (
61 /* Pad the segment with underscore(s) if segment is short */
68 /* Convert the character to uppercase and save it */
70 - Result[i] = (char) toupper ((int) *ExternalName);
71 + TmpSeg[i] = (char) toupper ((int) *ExternalName);
75 + AcpiUtWriteUint (Result, ACPI_NAMESEG_SIZE, TmpSeg, ACPI_NAMESEG_SIZE);
77 /* Now we must have a path separator, or the pathname is bad */