All of lore.kernel.org
 help / color / mirror / Atom feed
* [Devel] [PATCH] faulty name compares on big-endian machines
@ 2013-03-22  1:02 Al Stone
  0 siblings, 0 replies; only message in thread
From: Al Stone @ 2013-03-22  1:02 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

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(-)

diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
index 99b17e6..bd6272a 100644
--- a/source/compiler/aslanalyze.c
+++ b/source/compiler/aslanalyze.c
@@ -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") */

-- 
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-22  1:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22  1:02 [Devel] [PATCH] faulty name compares on big-endian machines Al Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.