diff --git a/sys/arch/mips/include/cpuregs.h b/sys/arch/mips/include/cpuregs.h index 54311c77e13f..c5f314ee899d 100644 --- a/sys/arch/mips/include/cpuregs.h +++ b/sys/arch/mips/include/cpuregs.h @@ -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 --git a/sys/arch/mips/mips/trap.c b/sys/arch/mips/mips/trap.c index 47255cf5a2bc..15dd0cdb6f7d 100644 --- a/sys/arch/mips/mips/trap.c +++ b/sys/arch/mips/mips/trap.c @@ -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 -__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, vaddr_t vaddr, vaddr_t pc, 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