svn commit: r201880 - projects/mips/sys/mips/mips

Neel Natu neel at FreeBSD.org
Sat Jan 9 02:17:14 UTC 2010


Author: neel
Date: Sat Jan  9 02:17:14 2010
New Revision: 201880
URL: http://svn.freebsd.org/changeset/base/201880

Log:
  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)

Modified:
  projects/mips/sys/mips/mips/trap.c

Modified: projects/mips/sys/mips/mips/trap.c
==============================================================================
--- projects/mips/sys/mips/mips/trap.c	Sat Jan  9 01:46:38 2010	(r201879)
+++ projects/mips/sys/mips/mips/trap.c	Sat Jan  9 02:17:14 2010	(r201880)
@@ -1091,7 +1091,7 @@ MipsEmulateBranch(struct trapframe *fram
 	case OP_J:
 	case OP_JAL:
 		retAddr = (inst.JType.target << 2) |
-		    ((unsigned)instPC & 0xF0000000);
+		    ((unsigned)(instPC + 4) & 0xF0000000);
 		break;
 
 	case OP_BEQ:


More information about the svn-src-projects mailing list