2009-11-25 Michael Walle <michael@walle.cc>

* shared/gdbstub/lm32-stub.c: Fix wrong computation of negative branch
	targets (thanks to Manfred Scheible <mscheible@husware.de>.
This commit is contained in:
Joel Sherrill
2009-11-25 22:55:51 +00:00
parent 68049df7fb
commit 7455087f4f
2 changed files with 7 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2009-11-25 Michael Walle <michael@walle.cc>
* shared/gdbstub/lm32-stub.c: Fix wrong computation of negative branch
targets (thanks to Manfred Scheible <mscheible@husware.de>.
2009-11-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* shared/tsmac/tsmac.c: Remove unused vars.

View File

@@ -740,7 +740,7 @@ void handle_exception(void)
{
branch_step = 1;
branch_target = registers[LM32_REG_PC]
+ ((signed)(insn & 0x3ffffff) << 2);
+ (((signed)insn << 6) >> 4);
}
else if ( (opcode == 0x44000000)
|| (opcode == 0x48000000)
@@ -752,7 +752,7 @@ void handle_exception(void)
{
branch_step = 1;
branch_target = registers[LM32_REG_PC] +
+ ((signed)(insn & 0x0000ffff) << 2);
+ (((signed)insn << 16) >> 14);
}
else if ( (opcode == 0xd8000000)
|| (opcode == 0xc0000000)