Module Name:    src
Committed By:   simonb
Date:           Mon Jul 13 09:00:40 UTC 2020

Modified Files:
        src/sys/arch/mips/include: cpuregs.h
        src/sys/arch/mips/mips: trap.c

Log Message:
Remove a magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/mips/include/cpuregs.h
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/mips/mips/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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.99 src/sys/arch/mips/include/cpuregs.h:1.100
--- src/sys/arch/mips/include/cpuregs.h:1.99	Sun May 24 07:15:24 2020
+++ src/sys/arch/mips/include/cpuregs.h	Mon Jul 13 09:00:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.99 2020/05/24 07:15:24 simonb Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.100 2020/07/13 09:00:40 simonb Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -188,6 +188,9 @@
  */
 #define	MIPS_CR_BR_DELAY	0x80000000
 #define	MIPS_CR_COP_ERR		0x30000000
+#define	 MIPS_CR_COP_ERR_CU1	  1
+#define	 MIPS_CR_COP_ERR_CU2	  2
+#define	 MIPS_CR_COP_ERR_CU3	  3
 #define	MIPS1_CR_EXC_CODE	0x0000003C	/* four bits */
 #define	MIPS3_CR_EXC_CODE	0x0000007C	/* five bits */
 #define	MIPS_CR_IP		0x0000FF00

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.254 src/sys/arch/mips/mips/trap.c:1.255
--- src/sys/arch/mips/mips/trap.c:1.254	Thu Jun 25 08:00:49 2020
+++ src/sys/arch/mips/mips/trap.c	Mon Jul 13 09:00:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.254 2020/06/25 08:00:49 simonb Exp $	*/
+/*	$NetBSD: trap.c,v 1.255 2020/07/13 09:00:40 simonb Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.254 2020/06/25 08:00:49 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.255 2020/07/13 09:00:40 simonb Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -600,7 +600,7 @@ trap(uint32_t status, uint32_t cause, va
 	case T_RES_INST+T_USER:
 	case T_COP_UNUSABLE+T_USER:
 #if !defined(FPEMUL) && !defined(NOFPU)
-		if ((cause & MIPS_CR_COP_ERR) == 0x10000000) {
+		if (__SHIFTOUT(cause, MIPS_CR_COP_ERR) == MIPS_CR_COP_ERR_CU1) {
 			fpu_load();          	/* load FPA */
 		} else
 #endif

Reply via email to