Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips Simplify, don't use ifdefs to optimize out DIA...



details:   https://anonhg.NetBSD.org/src/rev/75ce260c9c3f
branches:  trunk
changeset: 358441:75ce260c9c3f
user:      maya <maya%NetBSD.org@localhost>
date:      Fri Dec 29 09:27:01 2017 +0000

description:
Simplify, don't use ifdefs to optimize out DIAGNOSTIC assertions.
Make the test for the n32/n64 case meaningful.

tested on pmax (o32).

diffstat:

 sys/arch/mips/include/reg.h          |   4 +---
 sys/arch/mips/mips/process_machdep.c |  14 +++++++-------
 2 files changed, 8 insertions(+), 10 deletions(-)

diffs (55 lines):

diff -r 3236a4eb4b9d -r 75ce260c9c3f sys/arch/mips/include/reg.h
--- a/sys/arch/mips/include/reg.h       Fri Dec 29 08:58:57 2017 +0000
+++ b/sys/arch/mips/include/reg.h       Fri Dec 29 09:27:01 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reg.h,v 1.17 2017/12/09 03:22:33 christos Exp $        */
+/*     $NetBSD: reg.h,v 1.18 2017/12/29 09:27:01 maya Exp $    */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -78,10 +78,8 @@
        __register64_t  r_regs[8];
 };
 
-#if defined(__mips_n32) || defined(__mips_n64)
 struct fpreg_oabi {
        int32_t         r_regs[33];
 };
-#endif
 
 #endif /*_MIPS_REG_H_*/
diff -r 3236a4eb4b9d -r 75ce260c9c3f sys/arch/mips/mips/process_machdep.c
--- a/sys/arch/mips/mips/process_machdep.c      Fri Dec 29 08:58:57 2017 +0000
+++ b/sys/arch/mips/mips/process_machdep.c      Fri Dec 29 09:27:01 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.38 2017/03/16 16:13:20 chs Exp $ */
+/*     $NetBSD: process_machdep.c,v 1.39 2017/12/29 09:27:01 maya Exp $        */
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.38 2017/03/16 16:13:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.39 2017/12/29 09:27:01 maya Exp $");
 
 /*
  * This file may seem a bit stylized, but that so that it's easier to port.
@@ -159,11 +159,11 @@
        fpu_discard(l);
 #endif /* !NOFPU */
 
-#if defined(__mips_n32) || defined(__mips_n64)
-       KASSERT((_MIPS_SIM_NEWABI_P(l->l_proc->p_md.md_abi) ? sizeof(struct fpreg) : sizeof(struct fpreg_oabi)) == regslen);
-#else
-       KASSERT(regslen == sizeof(struct fpreg));
-#endif
+       if (_MIPS_SIM_NEWABI_P(l->l_proc->p_md.md_abi))
+               KASSERT(regslen == sizeof(struct fpreg));
+       else
+               KASSERT(regslen == sizeof(struct fpreg_oabi));
+
        memcpy(&pcb->pcb_fpregs, regs, regslen);
        return 0;
 }



Home | Main Index | Thread Index | Old Index