Skip to contentSkip to conversation

faulty name compares on big-endian machines

PATCH New Al Stone 1 participant 1 message Mar 22, 2013 ACPI component architecture (acpica)

lore
Share & tools
lore

Al Stone

author
#0 lore raw

PATCH 1/1 faulty name compares on big-endian machines

When iasl is checking for GPE name conflicts on big-endian machines, the comparisons will fail when they should succeed.

The failure is due to the name bytes being in the wrong order. The bytes are in the wrong order because the name is being treated as a 32-bit integer and not as a string.

This patch causes the name to be used as a string and works properly on big- and little-endian machines running iasl.

This was found by running tests/misc/badcode.asl through iasl on a big-endian machine (PPC and s390) and noting that it would not catch the error at line 184 in badcode.asl that was being caught elsewhere.

Signed-off-by: Al Stone <ahs3(a)redhat.com>
--
source/compiler/aslanalyze.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
source/compiler/aslanalyze.c +2 -2
index 99b17e6..bd6272a 100644
@@ -516,7 +516,7 @@ ApCheckForGpeNameConflict (
 
      /* Need a null-terminated string version of NameSeg */
 
-    ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg);
+    ACPI_MOVE_NAME (Name, &Op->Asl.NameSeg);
      Name[ACPI_NAME_SIZE] = 0;
 
      /*
@@ -543,7 +543,7 @@ ApCheckForGpeNameConflict (
       * We are now sure we have an _Lxx or _Exx.
       * Create the target name that would cause collision (Flip E/L)
       */
-    ACPI_MOVE_32_TO_32 (Target, Name);
+    ACPI_MOVE_NAME (Target, Name);
 
      /* Inject opposite letter ("L" versus "E") */
 
Signature · 8 lines
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------