Module Name:    src
Committed By:   joerg
Date:           Wed Jul 30 23:56:01 UTC 2014

Modified Files:
        src/sys/arch/powerpc/booke: trap.c trap_subr.S

Log Message:
Replace mfpir with mfspr r, 286. The Power ISA and GAS disagree on the
semantics of this instruction, so prefer the well defined replacement.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/trap_subr.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.23 src/sys/arch/powerpc/booke/trap.c:1.24
--- src/sys/arch/powerpc/booke/trap.c:1.23	Fri Aug 23 06:19:46 2013
+++ src/sys/arch/powerpc/booke/trap.c	Wed Jul 30 23:56:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.23 2013/08/23 06:19:46 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.24 2014/07/30 23:56:01 joerg Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.23 2013/08/23 06:19:46 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.24 2014/07/30 23:56:01 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -428,7 +428,7 @@ emulate_opcode(struct trapframe *tf, ksi
 	}
 
 	if (OPC_MFSPR_P(opcode, SPR_PIR)) {
-		__asm ("mfpir %0" : "=r"(tf->tf_fixreg[OPC_MFSPR_REG(opcode)]));
+		__asm ("mfspr %0, 286" : "=r"(tf->tf_fixreg[OPC_MFSPR_REG(opcode)]));
 		return true;
 	}
 

Index: src/sys/arch/powerpc/booke/trap_subr.S
diff -u src/sys/arch/powerpc/booke/trap_subr.S:1.8 src/sys/arch/powerpc/booke/trap_subr.S:1.9
--- src/sys/arch/powerpc/booke/trap_subr.S:1.8	Wed Aug  1 16:19:43 2012
+++ src/sys/arch/powerpc/booke/trap_subr.S	Wed Jul 30 23:56:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.8 2012/08/01 16:19:43 matt Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.9 2014/07/30 23:56:01 joerg Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID("$NetBSD: trap_subr.S,v 1.8 2012/08/01 16:19:43 matt Exp $")
+RCSID("$NetBSD: trap_subr.S,v 1.9 2014/07/30 23:56:01 joerg Exp $")
 
 	.globl	_C_LABEL(sctrapexit), _C_LABEL(trapexit), _C_LABEL(intrcall)
 
@@ -858,7 +858,7 @@ _C_LABEL(exception_init):
 	ori	%r5,%r6,_C_LABEL(perfmon_vector)@l
 	mtspr	SPR_IVOR35, %r5
 
-	mfpir	%r5		/* get Process ID register */
+	mfspr	%r5, 286	/* get Process ID register */
 	cmplwi	%r5,0
 	bnelr			/* return if non-0 (non-primary) */
 

Reply via email to