Module Name:    src
Committed By:   matt
Date:           Thu Jul 31 01:01:55 UTC 2014

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

Log Message:
Don't use numeric constants for SPR.  Use the symbolic name (SPR_PIR).
Add DBSR_BRT to KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/booke/trap.c

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.24 src/sys/arch/powerpc/booke/trap.c:1.25
--- src/sys/arch/powerpc/booke/trap.c:1.24	Wed Jul 30 23:56:01 2014
+++ src/sys/arch/powerpc/booke/trap.c	Thu Jul 31 01:01:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.24 2014/07/30 23:56:01 joerg Exp $	*/
+/*	$NetBSD: trap.c,v 1.25 2014/07/31 01:01:55 matt 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.24 2014/07/30 23:56:01 joerg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.25 2014/07/31 01:01:55 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -428,7 +428,9 @@ emulate_opcode(struct trapframe *tf, ksi
 	}
 
 	if (OPC_MFSPR_P(opcode, SPR_PIR)) {
-		__asm ("mfspr %0, 286" : "=r"(tf->tf_fixreg[OPC_MFSPR_REG(opcode)]));
+		__asm ("mfspr %0, %1"
+		    :	"=r"(tf->tf_fixreg[OPC_MFSPR_REG(opcode)])
+		    :	"n"(SPL_PIR));
 		return true;
 	}
 
@@ -525,7 +527,7 @@ debug_exception(struct trapframe *tf, ks
 	 * Ack the interrupt.
 	 */
 	mtspr(SPR_DBSR, tf->tf_esr);
-	KASSERT(tf->tf_esr & (DBSR_IAC1|DBSR_IAC2));
+	KASSERT(tf->tf_esr & (DBSR_IAC1|DBSR_IAC2|DBSR_BRT));
 	KASSERT((tf->tf_srr1 & PSL_SE) == 0);
 
 	/*

Reply via email to