Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips Remove a magic number.
details: https://anonhg.NetBSD.org/src/rev/fff9c96fcb12
branches: trunk
changeset: 935906:fff9c96fcb12
user: simonb <simonb%NetBSD.org@localhost>
date: Mon Jul 13 09:00:40 2020 +0000
description:
Remove a magic number.
diffstat:
sys/arch/mips/include/cpuregs.h | 5 ++++-
sys/arch/mips/mips/trap.c | 6 +++---
2 files changed, 7 insertions(+), 4 deletions(-)
diffs (46 lines):
diff -r a7d9a6112c13 -r fff9c96fcb12 sys/arch/mips/include/cpuregs.h
--- a/sys/arch/mips/include/cpuregs.h Mon Jul 13 08:59:34 2020 +0000
+++ b/sys/arch/mips/include/cpuregs.h Mon Jul 13 09:00:40 2020 +0000
@@ -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
diff -r a7d9a6112c13 -r fff9c96fcb12 sys/arch/mips/mips/trap.c
--- a/sys/arch/mips/mips/trap.c Mon Jul 13 08:59:34 2020 +0000
+++ b/sys/arch/mips/mips/trap.c Mon Jul 13 09:00:40 2020 +0000
@@ -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 @@
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
Home |
Main Index |
Thread Index |
Old Index