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:
parent
f7c48f09b3
commit
a3e02917f3
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user