Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f911c685 authored by David Howells's avatar David Howells Committed by Linus Torvalds
Browse files

MN10300: Fix register-postinc addressing misalignment handling



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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b308bf3b
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -543,7 +543,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params,
{
{
	unsigned long *postinc = NULL, address = 0, tmp;
	unsigned long *postinc = NULL, address = 0, tmp;


	params &= 0x7fffffff;
	params &= 0x00ffffff;


	do {
	do {
		switch (params & 0xff) {
		switch (params & 0xff) {
@@ -631,6 +631,7 @@ static int misalignment_addr(unsigned long *registers, unsigned params,
			address += disp;
			address += disp;
			break;
			break;
		default:
		default:
			BUG();
			return 0;
			return 0;
		}
		}
	} while ((params >>= 8));
	} while ((params >>= 8));
@@ -697,6 +698,7 @@ static int misalignment_reg(unsigned long *registers, unsigned params,
		break;
		break;


	default:
	default:
		BUG();
		return 0;
		return 0;
	}
	}