Skip to content

Commit

Permalink
MN10300: Fix register-postinc addressing misalignment handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Howells authored and Linus Torvalds committed Nov 12, 2008
1 parent b308bf3 commit f911c68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/mn10300/mm/misalignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -631,6 +631,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params,
address += disp;
break;
default:
BUG();
return 0;
}
} while ((params >>= 8));
Expand Down Expand Up @@ -697,6 +698,7 @@ static int misalignment_reg(unsigned long *registers, unsigned params,
break;

default:
BUG();
return 0;
}

Expand Down

0 comments on commit f911c68

Please sign in to comment.