Module Name:    src
Committed By:   maya
Date:           Fri Dec 29 09:27:01 UTC 2017

Modified Files:
        src/sys/arch/mips/include: reg.h
        src/sys/arch/mips/mips: process_machdep.c

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

tested on pmax (o32).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/include/reg.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/mips/mips/process_machdep.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/reg.h
diff -u src/sys/arch/mips/include/reg.h:1.17 src/sys/arch/mips/include/reg.h:1.18
--- src/sys/arch/mips/include/reg.h:1.17	Sat Dec  9 03:22:33 2017
+++ src/sys/arch/mips/include/reg.h	Fri Dec 29 09:27:01 2017
@@ -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 @@ struct dspreg64 {
 	__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_*/

Index: src/sys/arch/mips/mips/process_machdep.c
diff -u src/sys/arch/mips/mips/process_machdep.c:1.38 src/sys/arch/mips/mips/process_machdep.c:1.39
--- src/sys/arch/mips/mips/process_machdep.c:1.38	Thu Mar 16 16:13:20 2017
+++ src/sys/arch/mips/mips/process_machdep.c	Fri Dec 29 09:27:01 2017
@@ -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 @@ process_write_fpregs(struct lwp *l, cons
 	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;
 }

Reply via email to