]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
MN10300: Fix register-postinc addressing misalignment handling
authorDavid Howells <dhowells@redhat.com>
Wed, 12 Nov 2008 15:35:20 +0000 (15:35 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Nov 2008 18:41:17 +0000 (10:41 -0800)
Fix misalignment handling of operands with register postincrement addressing.
The flag to indicate that postincrement is required should not be interpreted
as an specification of a value to be added to the address.

Also add BUGs to catch unimplemented parameter markings in the opcodes table.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/mn10300/mm/misalignment.c

index 614c32b6325b52f3b167d0ca486b0d6b78fa85ad..066ddc625a1464a0bd044bec96edd6aea6a4efdc 100644 (file)
@@ -543,7 +543,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params,
 {
        unsigned long *postinc = NULL, address = 0, tmp;
 
-       params &= 0x7fffffff;
+       params &= 0x00ffffff;
 
        do {
                switch (params & 0xff) {
@@ -631,6 +631,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params,
                        address += disp;
                        break;
                default:
+                       BUG();
                        return 0;
                }
        } while ((params >>= 8));
@@ -697,6 +698,7 @@ static int misalignment_reg(unsigned long *registers, unsigned params,
                break;
 
        default:
+               BUG();
                return 0;
        }