1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

Compute the target of the jump in the 'J' and 'JAL' instructions

correctly. The 256MB segment is formed by taking the top 4 bits
of the address of the instruction in the "branch delay" slot
as opposed to the 'J' or 'JAL' instruction itself.

Approved by: imp (mentor)
This commit is contained in:
Neel Natu 2010-01-09 02:17:14 +00:00
parent 46b2483132
commit 15258244de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/mips/; revision=201880

View File

@ -1091,7 +1091,7 @@ MipsEmulateBranch(struct trapframe *framePtr, uintptr_t instPC, int fpcCSR,
case OP_J:
case OP_JAL:
retAddr = (inst.JType.target << 2) |
((unsigned)instPC & 0xF0000000);
((unsigned)(instPC + 4) & 0xF0000000);
break;
case OP_BEQ: