CVS commit: src/lib/libc/arch/mips/gen

2017-02-26 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Feb 27 06:55:26 UTC 2017

Modified Files:
src/lib/libc/arch/mips/gen: fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
fix asm operands: "ctc1" uses the register as an input, not an output.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/fpsetround.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.9 src/lib/libc/arch/mips/gen/fpsetmask.c:1.10
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.9	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.10 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.10 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetmask(fp_except mask)
 	new = old & ~(0x1f << 7); 
 	new |= ((mask & 0x1f) << 7);
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return (old >> 7) & 0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpsetsticky.c:1.9 src/lib/libc/arch/mips/gen/fpsetsticky.c:1.10
--- src/lib/libc/arch/mips/gen/fpsetsticky.c:1.9	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetsticky.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.10 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.10 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetsticky(fp_except sticky)
 	new = old & ~(0x1f << 2); 
 	new |= (sticky & 0x1f) << 2;
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return (old >> 2) & 0x1f;
 }

Index: src/lib/libc/arch/mips/gen/fpsetround.c
diff -u src/lib/libc/arch/mips/gen/fpsetround.c:1.7 src/lib/libc/arch/mips/gen/fpsetround.c:1.8
--- src/lib/libc/arch/mips/gen/fpsetround.c:1.7	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetround.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.7 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.8 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.7 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.8 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetround(fp_rnd rnd_dir)
 	new = old & ~0x03;
 	new |= rnd_dir & 0x03;
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return old & 0x03;
 }



CVS commit: src/lib/libc/arch/mips/gen

2016-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:49:40 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S swapcontext.S

Log Message:
Fix for [on]{32,64}

/usr/tests/lib/libc/sys/t_getcontext
/usr/tests/lib/libc/sys/t_swapcontext
/usr/tests/lib/libc/sys/t_ucontext
/usr/tests/lib/libpthread/t_swapcontext

All pass now.

Changes amount to

- saving GP from caller in context for n{32,64}
- performing (the equivalient of) PIC_PROLOGUE for swapcontext and
  __resumecontext
- Call setcontext via the PLT in __resumecontext


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/mips/gen/_resumecontext.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/mips/gen/swapcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.10 src/lib/libc/arch/mips/gen/_resumecontext.S:1.11
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.10	Sat Aug 13 08:09:17 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Wed Sep 21 06:49:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.11 2016/09/21 06:49:39 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.11 2016/09/21 06:49:39 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -44,17 +44,36 @@
 LEAF_NOPROFILE(__resumecontext)
 	/*
 	 * We get here not by a call through $t9 but thru $ra after the
-	 * function passed to makecontext returns.
+	 * function passed to makecontext returns.  Therefore, we need
+	 * to recover gp from ra
 	 */
+#if defined(__mips_o32) || defined(__mips_o64)
+	.set push
+	.set noreorder
+	.cpload	ra
+	.set pop
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+	.cpsetup ra, t3, __resumecontext
+#endif
+	
 	PTR_SUBU	sp, sp, UCONTEXT_SIZE		# get space for ucontext
 	move		a0, sp# arg0 for getcontext
 	PTR_S		zero, _OFFSETOF_UC_LINK(a0)	# make sure uc_link is 0
 	SYSTRAP(getcontext)# get context
+
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_PROLOGUE
+	/* We saved gp in t2 above */
+	REG_S		t3, _OFFSETOF_UC_GREGS_GP(a0)
+	REG_EPILOGUE
+#endif
+
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
 	NOP_L
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
-	SYSTRAP(setcontext)#   yes, become it.
+	PIC_TAILCALL(setcontext)			#   yes, become it.
 	/* NOTREACHED (in theory) */
 	li		a0, -1# failure,
 1:

Index: src/lib/libc/arch/mips/gen/swapcontext.S
diff -u src/lib/libc/arch/mips/gen/swapcontext.S:1.6 src/lib/libc/arch/mips/gen/swapcontext.S:1.7
--- src/lib/libc/arch/mips/gen/swapcontext.S:1.6	Wed Sep 21 06:41:42 2016
+++ src/lib/libc/arch/mips/gen/swapcontext.S	Wed Sep 21 06:49:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.7 2016/09/21 06:49:39 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,13 +33,14 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.7 2016/09/21 06:49:39 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
 
 NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	.mask	0x8030, (CALLFRAME_RA - CALLFRAME_SIZ)
+	PIC_PROLOGUE(swapcontext)
 	PTR_SUBU	sp, sp, CALLFRAME_SIZ
 	PTR_S		ra, CALLFRAME_RA(sp)	# save ra
 	PTR_S		a0, 0(sp)		# stash away oucp
@@ -53,6 +54,10 @@ NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	PTR_ADDIU	v0, sp, CALLFRAME_SIZ
 	REG_PROLOGUE
 	REG_S		zero, _OFFSETOF_UC_GREGS_V0(v1)
+#if defined(__mips_n32) || defined(__mips_n64)
+	/* PIC_PROLOGUE saved gp in t3 */
+	REG_S		t3, _OFFSETOF_UC_GREGS_GP(v1)
+#endif
 	REG_S		ra, _OFFSETOF_UC_GREGS_EPC(v1)
 	REG_S		v0, _OFFSETOF_UC_GREGS_SP(v1)
 	REG_EPILOGUE



CVS commit: src/lib/libc/arch/mips/gen

2016-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:41:42 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: swapcontext.S

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/gen/swapcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/swapcontext.S
diff -u src/lib/libc/arch/mips/gen/swapcontext.S:1.5 src/lib/libc/arch/mips/gen/swapcontext.S:1.6
--- src/lib/libc/arch/mips/gen/swapcontext.S:1.5	Wed Sep 12 02:00:52 2012
+++ src/lib/libc/arch/mips/gen/swapcontext.S	Wed Sep 21 06:41:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.5 2012/09/12 02:00:52 manu Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,11 +33,11 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.5 2012/09/12 02:00:52 manu Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
-	
+
 NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	.mask	0x8030, (CALLFRAME_RA - CALLFRAME_SIZ)
 	PTR_SUBU	sp, sp, CALLFRAME_SIZ



CVS commit: src/lib/libc/arch/mips/gen

2016-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 13 08:09:17 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
Add a NOP_L


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/mips/gen/_resumecontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.9 src/lib/libc/arch/mips/gen/_resumecontext.S:1.10
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.9	Sat Aug 13 07:49:32 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Sat Aug 13 08:09:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -51,6 +51,7 @@ LEAF_NOPROFILE(__resumecontext)
 	PTR_S		zero, _OFFSETOF_UC_LINK(a0)	# make sure uc_link is 0
 	SYSTRAP(getcontext)# get context
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
+	NOP_L
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
 	SYSTRAP(setcontext)#   yes, become it.



CVS commit: src/lib/libc/arch/mips/gen

2016-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 13 07:49:32 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
PIC_TAILCALL on n32/n64 would mess up GP, so just use SYSTRAP to call
setcontext.

Fixes tests/lib/libc/sys/t_getcontext.c:setcontext_link


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/mips/gen/_resumecontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.8 src/lib/libc/arch/mips/gen/_resumecontext.S:1.9
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.8	Fri Aug 12 15:21:25 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Sat Aug 13 07:49:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -53,7 +53,7 @@ LEAF_NOPROFILE(__resumecontext)
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
-	PIC_TAILCALL(setcontext)			#   yes, become it.
+	SYSTRAP(setcontext)#   yes, become it.
 	/* NOTREACHED (in theory) */
 	li		a0, -1# failure,
 1:



CVS commit: src/lib/libc/arch/mips/gen

2016-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 12 15:21:25 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/_resumecontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.7 src/lib/libc/arch/mips/gen/_resumecontext.S:1.8
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.7	Wed Sep 12 02:00:52 2012
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Fri Aug 12 15:21:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.7 2012/09/12 02:00:52 manu Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,12 +35,12 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.7 2012/09/12 02:00:52 manu Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
 	.hidden	_C_LABEL(__resumecontext)
-	
+
 LEAF_NOPROFILE(__resumecontext)
 	/*
 	 * We get here not by a call through $t9 but thru $ra after the
@@ -55,7 +55,7 @@ LEAF_NOPROFILE(__resumecontext)
 	nop
 	PIC_TAILCALL(setcontext)			#   yes, become it.
 	/* NOTREACHED (in theory) */
-	li		a0, -1# failure, 
+	li		a0, -1# failure,
 1:
 	SYSTRAP(exit)	# all hope is lost.
 	/* NOTREACHED */



CVS commit: src/lib/libc/arch/mips/gen

2016-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 10 16:40:24 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: makecontext.c

Log Message:
Fix comments


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/makecontext.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/makecontext.c
diff -u src/lib/libc/arch/mips/gen/makecontext.c:1.7 src/lib/libc/arch/mips/gen/makecontext.c:1.8
--- src/lib/libc/arch/mips/gen/makecontext.c:1.7	Tue Sep 20 08:42:29 2011
+++ src/lib/libc/arch/mips/gen/makecontext.c	Wed Aug 10 16:40:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.7 2011/09/20 08:42:29 joerg Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.8 2016/08/10 16:40:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.7 2011/09/20 08:42:29 joerg Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.8 2016/08/10 16:40:24 skrll Exp $");
 #endif
 
 #include 
@@ -85,9 +85,8 @@ makecontext(ucontext_t *ucp, void (*func
 	for (i = 0; i < argc && i < 8; i++)
 		/* LINTED __greg_t is safe */
 		gr[_REG_A0 + i] = va_arg(ap, __greg_t);
-	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	/* Pass remaining arguments on the stack */
 #endif
-	/* Pass remaining arguments on the stack above the $a0-3 gap. */
 	for (; i < argc; i++)
 		/* LINTED uintptr_t is safe */
 		*sp++ = va_arg(ap, __greg_t);



CVS commit: src/lib/libc/arch/mips/gen

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 16:01:56 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: Makefile.inc

Log Message:
cache stuff needs _KERNTYPES


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/arch/mips/gen/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/Makefile.inc
diff -u src/lib/libc/arch/mips/gen/Makefile.inc:1.33 src/lib/libc/arch/mips/gen/Makefile.inc:1.34
--- src/lib/libc/arch/mips/gen/Makefile.inc:1.33	Tue Mar 15 03:40:18 2011
+++ src/lib/libc/arch/mips/gen/Makefile.inc	Sun Jan 24 11:01:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.33 2011/03/15 07:40:18 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.34 2016/01/24 16:01:56 christos Exp $
 
 .if ${MKSOFTFLOAT} == "no"
 SRCS+=	fabs.S ldexp.S modf.S
@@ -33,6 +33,7 @@ SRCS+=	makecontext.c resumecontext.c _re
 SRCS+=	cacheflush.c
 
 CPPFLAGS._lwp.c	+= -D_LIBC_SOURCE
+CPPFLAGS.cacheflush.c	+= -D_KERNTYPES
 
 LSRCS.mips.gen=	Lint__setjmp.c Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c
 LSRCS+=		${LSRCS.mips.gen}



CVS commit: src/lib/libc/arch/mips/gen

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 16:01:43 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: longjmp.c

Log Message:
Use namespace protected types.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/gen/longjmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/longjmp.c
diff -u src/lib/libc/arch/mips/gen/longjmp.c:1.5 src/lib/libc/arch/mips/gen/longjmp.c:1.6
--- src/lib/libc/arch/mips/gen/longjmp.c:1.5	Thu Mar 29 15:27:05 2012
+++ src/lib/libc/arch/mips/gen/longjmp.c	Sun Jan 24 11:01:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: longjmp.c,v 1.5 2012/03/29 19:27:05 christos Exp $	*/
+/*	$NetBSD: longjmp.c,v 1.6 2016/01/24 16:01:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ __longjmp14(jmp_buf env, int val)
 	ucontext_t uc;
 
 	/* Ensure non-zero SP and sigcontext magic number is present */
-	if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != (mips_reg_t)0xACEDBADEU)
+	if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != (__register_t)0xACEDBADEU)
 		goto err;
 
 	/* Ensure non-zero return value */



CVS commit: src/lib/libc/arch/mips/gen

2014-09-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep 17 11:01:05 UTC 2014

Modified Files:
src/lib/libc/arch/mips/gen: ldexp.S

Log Message:
Use canonical three operand form of add.d.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/mips/gen/ldexp.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/ldexp.S
diff -u src/lib/libc/arch/mips/gen/ldexp.S:1.9 src/lib/libc/arch/mips/gen/ldexp.S:1.10
--- src/lib/libc/arch/mips/gen/ldexp.S:1.9	Mon Dec 14 01:07:42 2009
+++ src/lib/libc/arch/mips/gen/ldexp.S	Wed Sep 17 11:01:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldexp.S,v 1.9 2009/12/14 01:07:42 matt Exp $	*/
+/*	$NetBSD: ldexp.S,v 1.10 2014/09/17 11:01:05 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 	RCSID(from: @(#)ldexp.s	8.1 (Berkeley) 6/4/93)
 #else
-	RCSID($NetBSD: ldexp.S,v 1.9 2009/12/14 01:07:42 matt Exp $)
+	RCSID($NetBSD: ldexp.S,v 1.10 2014/09/17 11:01:05 joerg Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -209,7 +209,7 @@ LEAF(ldexp)
 	bge	v1, zero, 1f		# should result be negative infinity?
 	neg.d	$f0, $f0		# result is negative infinity
 1:
-	add.d	$f0, $f0		# cause overflow faults if enabled
+	add.d	$f0, $f0, $f0		# cause overflow faults if enabled
 	j	ra
 9:
 	mov.d	$f0, $f12		# yes, result is just x



CVS commit: src/lib/libc/arch/mips/gen

2014-09-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep 17 11:02:55 UTC 2014

Modified Files:
src/lib/libc/arch/mips/gen: flt_rounds.c fpgetmask.c fpgetround.c
fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
Explicitly set noat around instructions using $at.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/flt_rounds.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/mips/gen/fpgetmask.c \
src/lib/libc/arch/mips/gen/fpgetsticky.c \
src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/mips/gen/fpgetround.c \
src/lib/libc/arch/mips/gen/fpsetround.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/flt_rounds.c
diff -u src/lib/libc/arch/mips/gen/flt_rounds.c:1.7 src/lib/libc/arch/mips/gen/flt_rounds.c:1.8
--- src/lib/libc/arch/mips/gen/flt_rounds.c:1.7	Sun Jun 24 15:26:02 2012
+++ src/lib/libc/arch/mips/gen/flt_rounds.c	Wed Sep 17 11:02:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.7 2012/06/24 15:26:02 christos Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.8 2014/09/17 11:02:55 joerg Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: flt_rounds.c,v 1.7 2012/06/24 15:26:02 christos Exp $);
+__RCSID($NetBSD: flt_rounds.c,v 1.8 2014/09/17 11:02:55 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include machine/float.h
@@ -28,7 +28,7 @@ __flt_rounds(void)
 #else
 	int x;
 
-	__asm(cfc1\t%0,$31 : =r (x));
+	__asm(.set push; .set noat; cfc1 %0,$31; .set pop : =r (x));
 	return map[x  0x03];
 #endif
 }

Index: src/lib/libc/arch/mips/gen/fpgetmask.c
diff -u src/lib/libc/arch/mips/gen/fpgetmask.c:1.8 src/lib/libc/arch/mips/gen/fpgetmask.c:1.9
--- src/lib/libc/arch/mips/gen/fpgetmask.c:1.8	Tue Mar 20 16:19:56 2012
+++ src/lib/libc/arch/mips/gen/fpgetmask.c	Wed Sep 17 11:02:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
+/*	$NetBSD: fpgetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
+__RCSID($NetBSD: fpgetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -23,6 +23,6 @@ fpgetmask(void)
 {
 	fp_except x;
 
-	__asm(cfc1 %0,$31 : =r (x));
+	__asm(.set push; .set noat; cfc1 %0,$31; .set pop : =r (x));
 	return (x  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpgetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpgetsticky.c:1.8 src/lib/libc/arch/mips/gen/fpgetsticky.c:1.9
--- src/lib/libc/arch/mips/gen/fpgetsticky.c:1.8	Tue Mar 20 16:19:56 2012
+++ src/lib/libc/arch/mips/gen/fpgetsticky.c	Wed Sep 17 11:02:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
+__RCSID($NetBSD: fpgetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -23,6 +23,6 @@ fpgetsticky(void)
 {
 	fp_except x;
 
-	__asm(cfc1 %0,$31 : =r (x));
+	__asm(.set push; .set noat; cfc1 %0,$31; .set pop : =r (x));
 	return (x  2)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.8 src/lib/libc/arch/mips/gen/fpsetmask.c:1.9
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.8	Tue Mar 20 16:19:56 2012
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Wed Sep 17 11:02:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
+__RCSID($NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -24,12 +24,12 @@ fpsetmask(fp_except mask)
 	fp_except old;
 	fp_except new;
 
-	__asm(cfc1 %0,$31 : =r (old));
+	__asm(.set push; .set noat; cfc1 %0,$31; .set pop : =r (old));
 
 	new = old  ~(0x1f  7); 
 	new |= ((mask  0x1f)  7);
 
-	__asm(ctc1 %0,$31 : : r (new));
+	__asm(.set push; .set noat; ctc1 %0,$31; .set pop : =r (new));
 
 	return (old  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpsetsticky.c:1.8 src/lib/libc/arch/mips/gen/fpsetsticky.c:1.9
--- 

CVS commit: src/lib/libc/arch/mips/gen

2012-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  8 00:59:34 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: _setjmp.S

Log Message:
Slight optimization.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/arch/mips/gen/_setjmp.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_setjmp.S
diff -u src/lib/libc/arch/mips/gen/_setjmp.S:1.23 src/lib/libc/arch/mips/gen/_setjmp.S:1.24
--- src/lib/libc/arch/mips/gen/_setjmp.S:1.23	Wed Mar  9 16:10:29 2011
+++ src/lib/libc/arch/mips/gen/_setjmp.S	Sun Jul  8 00:59:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.24 2012/07/08 00:59:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@
 #if 0
 	RCSID(from: @(#)_setjmp.s	8.1 (Berkeley) 6/4/93)
 #else
-	RCSID($NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $)
+	RCSID($NetBSD: _setjmp.S,v 1.24 2012/07/08 00:59:34 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -113,7 +113,7 @@ LEAF(_setjmp)
 	REG_EPILOGUE
 
 	j	ra
-	move	v0, zero
+	 move	v0, zero
 END(_setjmp)
 
 LEAF(_longjmp)
@@ -175,9 +175,8 @@ LEAF(_longjmp)
 #endif	/* SOFTFLOAT_FOR_GCC */
 
 	REG_EPILOGUE
-	move	v0, a1			# get return value in 1st arg
 	j	ra
-	nop
+	 move	v0, a1			# get return value in 1st arg
 
 botch:
 	/*



CVS commit: src/lib/libc/arch/mips/gen

2012-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 29 19:26:21 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: cacheflush.c

Log Message:
fix lint, should nbytes be changed to size_t to match with the struct passed?


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/mips/gen/cacheflush.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/cacheflush.c
diff -u src/lib/libc/arch/mips/gen/cacheflush.c:1.4 src/lib/libc/arch/mips/gen/cacheflush.c:1.5
--- src/lib/libc/arch/mips/gen/cacheflush.c:1.4	Mon Apr 28 16:22:56 2008
+++ src/lib/libc/arch/mips/gen/cacheflush.c	Thu Mar 29 15:26:21 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cacheflush.c,v 1.4 2008/04/28 20:22:56 martin Exp $ */
+/* $NetBSD: cacheflush.c,v 1.5 2012/03/29 19:26:21 christos Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -34,14 +34,12 @@
 #include mips/sysarch.h
 
 int
-_cacheflush(addr, nbytes, whichcache)
-	void * addr;
-	int nbytes, whichcache;
+_cacheflush(void *addr, int nbytes, int whichcache)
 {
 	struct mips_cacheflush_args cfa;
 
-	cfa.va = (vaddr_t) addr;
+	cfa.va = (vaddr_t)(intptr_t)addr;
 	cfa.nbytes = nbytes;
 	cfa.whichcache = whichcache;
-	return (sysarch(MIPS_CACHEFLUSH, (void *)cfa));
+	return sysarch(MIPS_CACHEFLUSH, (void *)cfa);
 }



CVS commit: src/lib/libc/arch/mips/gen

2012-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 29 19:27:05 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: longjmp.c

Log Message:
make constant explicitly unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/mips/gen/longjmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/longjmp.c
diff -u src/lib/libc/arch/mips/gen/longjmp.c:1.4 src/lib/libc/arch/mips/gen/longjmp.c:1.5
--- src/lib/libc/arch/mips/gen/longjmp.c:1.4	Fri Sep  3 13:22:51 2010
+++ src/lib/libc/arch/mips/gen/longjmp.c	Thu Mar 29 15:27:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: longjmp.c,v 1.4 2010/09/03 17:22:51 matt Exp $	*/
+/*	$NetBSD: longjmp.c,v 1.5 2012/03/29 19:27:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ __longjmp14(jmp_buf env, int val)
 	ucontext_t uc;
 
 	/* Ensure non-zero SP and sigcontext magic number is present */
-	if (sc-sc_regs[_R_SP] == 0 || sc-sc_regs[_R_ZERO] != (mips_reg_t)0xACEDBADE)
+	if (sc-sc_regs[_R_SP] == 0 || sc-sc_regs[_R_ZERO] != (mips_reg_t)0xACEDBADEU)
 		goto err;
 
 	/* Ensure non-zero return value */



CVS commit: src/lib/libc/arch/mips/gen

2012-03-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Tue Mar 20 10:51:24 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: fpgetmask.c fpgetsticky.c fpsetmask.c
fpsetsticky.c

Log Message:
Cast to unsigned int before doing shift operations, to appease lint.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/mips/gen/fpgetmask.c \
src/lib/libc/arch/mips/gen/fpgetsticky.c \
src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/fpgetmask.c
diff -u src/lib/libc/arch/mips/gen/fpgetmask.c:1.6 src/lib/libc/arch/mips/gen/fpgetmask.c:1.7
--- src/lib/libc/arch/mips/gen/fpgetmask.c:1.6	Mon Mar 19 22:23:10 2012
+++ src/lib/libc/arch/mips/gen/fpgetmask.c	Tue Mar 20 10:51:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
+/*	$NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
+__RCSID($NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -24,5 +24,5 @@ fpgetmask(void)
 	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
-	return (x  7)  0x1f;
+	return ((unsigned int)x  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpgetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpgetsticky.c:1.6 src/lib/libc/arch/mips/gen/fpgetsticky.c:1.7
--- src/lib/libc/arch/mips/gen/fpgetsticky.c:1.6	Mon Mar 19 22:23:10 2012
+++ src/lib/libc/arch/mips/gen/fpgetsticky.c	Tue Mar 20 10:51:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
+__RCSID($NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -24,5 +24,5 @@ fpgetsticky(void)
 	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
-	return (x  2)  0x1f;
+	return ((unsigned int)x  2)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.6 src/lib/libc/arch/mips/gen/fpsetmask.c:1.7
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.6	Mon Mar 19 22:23:10 2012
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Tue Mar 20 10:51:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
+__RCSID($NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -31,5 +31,5 @@ fpsetmask(fp_except mask)
 
 	__asm(ctc1 %0,$31 : : r (new));
 
-	return (old  7)  0x1f;
+	return ((unsigned int)old  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpsetsticky.c:1.6 src/lib/libc/arch/mips/gen/fpsetsticky.c:1.7
--- src/lib/libc/arch/mips/gen/fpsetsticky.c:1.6	Mon Mar 19 22:23:10 2012
+++ src/lib/libc/arch/mips/gen/fpsetsticky.c	Tue Mar 20 10:51:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
+__RCSID($NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -31,5 +31,5 @@ fpsetsticky(fp_except sticky)
 
 	__asm(ctc1 %0,$31 : : r (new));
 
-	return (old  2)  0x1f;
+	return ((unsigned int)old  2)  0x1f;
 }



CVS commit: src/lib/libc/arch/mips/gen

2012-03-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Mar 20 16:19:56 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: fpgetmask.c fpgetsticky.c fpsetmask.c
fpsetsticky.c

Log Message:
Revert unneeded casts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/fpgetmask.c \
src/lib/libc/arch/mips/gen/fpgetsticky.c \
src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/fpgetmask.c
diff -u src/lib/libc/arch/mips/gen/fpgetmask.c:1.7 src/lib/libc/arch/mips/gen/fpgetmask.c:1.8
--- src/lib/libc/arch/mips/gen/fpgetmask.c:1.7	Tue Mar 20 10:51:23 2012
+++ src/lib/libc/arch/mips/gen/fpgetmask.c	Tue Mar 20 16:19:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $	*/
+/*	$NetBSD: fpgetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetmask.c,v 1.7 2012/03/20 10:51:23 he Exp $);
+__RCSID($NetBSD: fpgetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -24,5 +24,5 @@ fpgetmask(void)
 	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
-	return ((unsigned int)x  7)  0x1f;
+	return (x  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpgetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpgetsticky.c:1.7 src/lib/libc/arch/mips/gen/fpgetsticky.c:1.8
--- src/lib/libc/arch/mips/gen/fpgetsticky.c:1.7	Tue Mar 20 10:51:24 2012
+++ src/lib/libc/arch/mips/gen/fpgetsticky.c	Tue Mar 20 16:19:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $);
+__RCSID($NetBSD: fpgetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -24,5 +24,5 @@ fpgetsticky(void)
 	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
-	return ((unsigned int)x  2)  0x1f;
+	return (x  2)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.7 src/lib/libc/arch/mips/gen/fpsetmask.c:1.8
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.7	Tue Mar 20 10:51:24 2012
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Tue Mar 20 16:19:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetmask.c,v 1.7 2012/03/20 10:51:24 he Exp $);
+__RCSID($NetBSD: fpsetmask.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -31,5 +31,5 @@ fpsetmask(fp_except mask)
 
 	__asm(ctc1 %0,$31 : : r (new));
 
-	return ((unsigned int)old  7)  0x1f;
+	return (old  7)  0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpsetsticky.c:1.7 src/lib/libc/arch/mips/gen/fpsetsticky.c:1.8
--- src/lib/libc/arch/mips/gen/fpsetsticky.c:1.7	Tue Mar 20 10:51:24 2012
+++ src/lib/libc/arch/mips/gen/fpsetsticky.c	Tue Mar 20 16:19:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetsticky.c,v 1.7 2012/03/20 10:51:24 he Exp $);
+__RCSID($NetBSD: fpsetsticky.c,v 1.8 2012/03/20 16:19:56 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -31,5 +31,5 @@ fpsetsticky(fp_except sticky)
 
 	__asm(ctc1 %0,$31 : : r (new));
 
-	return ((unsigned int)old  2)  0x1f;
+	return (old  2)  0x1f;
 }



CVS commit: src/lib/libc/arch/mips/gen

2012-03-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 19 22:23:11 UTC 2012

Modified Files:
src/lib/libc/arch/mips/gen: fpgetmask.c fpgetround.c fpgetsticky.c
fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
Convert to C89 definitions.
Cleanup up type usage.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/gen/fpgetmask.c \
src/lib/libc/arch/mips/gen/fpgetround.c \
src/lib/libc/arch/mips/gen/fpgetsticky.c \
src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetround.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/fpgetmask.c
diff -u src/lib/libc/arch/mips/gen/fpgetmask.c:1.5 src/lib/libc/arch/mips/gen/fpgetmask.c:1.6
--- src/lib/libc/arch/mips/gen/fpgetmask.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/fpgetmask.c	Mon Mar 19 22:23:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpgetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -19,9 +19,9 @@ __weak_alias(fpgetmask,_fpgetmask)
 #endif
 
 fp_except
-fpgetmask()
+fpgetmask(void)
 {
-	int x;
+	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
 	return (x  7)  0x1f;
Index: src/lib/libc/arch/mips/gen/fpgetround.c
diff -u src/lib/libc/arch/mips/gen/fpgetround.c:1.5 src/lib/libc/arch/mips/gen/fpgetround.c:1.6
--- src/lib/libc/arch/mips/gen/fpgetround.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/fpgetround.c	Mon Mar 19 22:23:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpgetround.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpgetround.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -19,9 +19,9 @@ __weak_alias(fpgetround,_fpgetround)
 #endif
 
 fp_rnd
-fpgetround()
+fpgetround(void)
 {
-	int x;
+	fp_rnd x;
 
 	__asm(cfc1 %0,$31 : =r (x));
 	return x  0x03;
Index: src/lib/libc/arch/mips/gen/fpgetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpgetsticky.c:1.5 src/lib/libc/arch/mips/gen/fpgetsticky.c:1.6
--- src/lib/libc/arch/mips/gen/fpgetsticky.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/fpgetsticky.c	Mon Mar 19 22:23:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpgetsticky.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -19,9 +19,9 @@ __weak_alias(fpgetsticky,_fpgetsticky)
 #endif
 
 fp_except
-fpgetsticky()
+fpgetsticky(void)
 {
-	int x;
+	fp_except x;
 
 	__asm(cfc1 %0,$31 : =r (x));
 	return (x  2)  0x1f;
Index: src/lib/libc/arch/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.5 src/lib/libc/arch/mips/gen/fpsetmask.c:1.6
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Mon Mar 19 22:23:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpsetmask.c,v 1.6 2012/03/19 22:23:10 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -19,16 +19,14 @@ __weak_alias(fpsetmask,_fpsetmask)
 #endif
 
 fp_except
-fpsetmask(mask)
-	fp_except mask;
+fpsetmask(fp_except mask)
 {
 	fp_except old;
 	fp_except new;
 
 	__asm(cfc1 %0,$31 : =r (old));
 
-	new = old;
-	new = ~(0x1f  7); 
+	new = old  ~(0x1f  7); 
 	new |= ((mask  0x1f)  7);
 
 	__asm(ctc1 %0,$31 : : r (new));
Index: src/lib/libc/arch/mips/gen/fpsetround.c
diff -u src/lib/libc/arch/mips/gen/fpsetround.c:1.5 src/lib/libc/arch/mips/gen/fpsetround.c:1.6
--- src/lib/libc/arch/mips/gen/fpsetround.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/fpsetround.c	Mon Mar 19 22:23:10 2012
@@ -1,4 +1,4 

CVS commit: src/lib/libc/arch/mips/gen

2011-04-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr 29 08:05:22 UTC 2011

Modified Files:
src/lib/libc/arch/mips/gen: _lwp.c

Log Message:
Use correct CALLFRAME_SIZ depending on ABI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/_lwp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_lwp.c
diff -u src/lib/libc/arch/mips/gen/_lwp.c:1.7 src/lib/libc/arch/mips/gen/_lwp.c:1.8
--- src/lib/libc/arch/mips/gen/_lwp.c:1.7	Tue Mar 15 07:40:18 2011
+++ src/lib/libc/arch/mips/gen/_lwp.c	Fri Apr 29 08:05:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.7 2011/03/15 07:40:18 matt Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.8 2011/04/29 08:05:22 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: _lwp.c,v 1.7 2011/03/15 07:40:18 matt Exp $);
+__RCSID($NetBSD: _lwp.c,v 1.8 2011/04/29 08:05:22 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -40,7 +40,11 @@
 #include lwp.h
 #include stdlib.h
 
-#define CALLFRAME_SIZ	24
+#if defined(__mips_o32) || defined(__mips_o64)
+#define CALLFRAME_SIZ	(6 * sizeof(void *))
+#else
+#define CALLFRAME_SIZ	(4 * sizeof(uint64_t))
+#endif
 
 void
 _lwp_makecontext(ucontext_t *u, void (*start)(void *),



CVS commit: src/lib/libc/arch/mips/gen

2011-03-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Mar 15 07:40:18 UTC 2011

Modified Files:
src/lib/libc/arch/mips/gen: Makefile.inc _lwp.c

Log Message:
Properly support the MIPS TLS ABI.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/arch/mips/gen/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/mips/gen/_lwp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/Makefile.inc
diff -u src/lib/libc/arch/mips/gen/Makefile.inc:1.32 src/lib/libc/arch/mips/gen/Makefile.inc:1.33
--- src/lib/libc/arch/mips/gen/Makefile.inc:1.32	Mon Jan 17 23:53:03 2011
+++ src/lib/libc/arch/mips/gen/Makefile.inc	Tue Mar 15 07:40:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.32 2011/01/17 23:53:03 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.33 2011/03/15 07:40:18 matt Exp $
 
 .if ${MKSOFTFLOAT} == no
 SRCS+=	fabs.S ldexp.S modf.S
@@ -32,6 +32,8 @@
 # mips abi builtin extensions (used by GCC for lexical-closure trampoline)
 SRCS+=	cacheflush.c
 
+CPPFLAGS._lwp.c	+= -D_LIBC_SOURCE
+
 LSRCS.mips.gen=	Lint__setjmp.c Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c
 LSRCS+=		${LSRCS.mips.gen}
 DPSRCS+=	${LSRCS.mips.gen}

Index: src/lib/libc/arch/mips/gen/_lwp.c
diff -u src/lib/libc/arch/mips/gen/_lwp.c:1.6 src/lib/libc/arch/mips/gen/_lwp.c:1.7
--- src/lib/libc/arch/mips/gen/_lwp.c:1.6	Thu Feb 24 04:28:42 2011
+++ src/lib/libc/arch/mips/gen/_lwp.c	Tue Mar 15 07:40:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.6 2011/02/24 04:28:42 joerg Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.7 2011/03/15 07:40:18 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: _lwp.c,v 1.6 2011/02/24 04:28:42 joerg Exp $);
+__RCSID($NetBSD: _lwp.c,v 1.7 2011/03/15 07:40:18 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -42,8 +42,9 @@
 
 #define CALLFRAME_SIZ	24
 
-void _lwp_makecontext(ucontext_t *u, void (*start)(void *),
-	void *arg, void *private, caddr_t stack_base, size_t stack_size)
+void
+_lwp_makecontext(ucontext_t *u, void (*start)(void *),
+	void *arg, void *tcb, caddr_t stack_base, size_t stack_size)
 {
 	caddr_t sp;
 	__greg_t *gr;
@@ -56,11 +57,12 @@
 	u-uc_stack.ss_size = stack_size;
 	sp = stack_base + stack_size - CALLFRAME_SIZ;
 
-	gr[_REG_EPC] = (unsigned long) start;
-	gr[_REG_T9] = (unsigned long) start; /* required for .abicalls */
-	gr[_REG_RA] = (unsigned long) _lwp_exit;
-	gr[_REG_A0] = (unsigned long) arg;
-	gr[_REG_SP] = (unsigned long) sp;
-	u-uc_mcontext._mc_tlsbase = (uintptr_t)private;
+	gr[_REG_EPC] = (uintptr_t) start;
+	gr[_REG_T9] = (uintptr_t) start; /* required for .abicalls */
+	gr[_REG_RA] = (uintptr_t) _lwp_exit;
+	gr[_REG_A0] = (uintptr_t) arg;
+	gr[_REG_SP] = (uintptr_t) sp;
+	u-uc_mcontext._mc_tlsbase =
+	(uintptr_t)tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb);
 	u-uc_flags |= _UC_TLSBASE;
 }



CVS commit: src/lib/libc/arch/mips/gen

2011-03-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar  9 16:10:29 UTC 2011

Modified Files:
src/lib/libc/arch/mips/gen: _setjmp.S

Log Message:
Reorder insns to fix more load delay hazard botches on R3000.
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/arch/mips/gen/_setjmp.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/gen/_setjmp.S
diff -u src/lib/libc/arch/mips/gen/_setjmp.S:1.22 src/lib/libc/arch/mips/gen/_setjmp.S:1.23
--- src/lib/libc/arch/mips/gen/_setjmp.S:1.22	Fri Sep  3 17:22:51 2010
+++ src/lib/libc/arch/mips/gen/_setjmp.S	Wed Mar  9 16:10:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@
 #if 0
 	RCSID(from: @(#)_setjmp.s	8.1 (Berkeley) 6/4/93)
 #else
-	RCSID($NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $)
+	RCSID($NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -88,7 +88,6 @@
 	 */
 #ifndef SOFTFLOAT_FOR_GCC
 	cfc1	v0, $31# too bad cant check if FP used
-	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 #if defined(__mips_n64) || defined(__mips_n32)
 	FP_S	$f30, _OFFSETOF_SC_FPREGS_F30(a0)
 	FP_S	$f28, _OFFSETOF_SC_FPREGS_F28(a0)
@@ -109,6 +108,7 @@
 	FP_S	$f29, _OFFSETOF_SC_FPREGS_F29(a0)
 	FP_S	$f31, _OFFSETOF_SC_FPREGS_F31(a0)
 #endif
+	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 #endif	/* SOFTFLOAT_FOR_GCC */
 	REG_EPILOGUE
 
@@ -139,11 +139,13 @@
 #if defined(__mips_n32) || defined(__mips_n64)
 	REG_L		gp, _OFFSETOF_SC_REGS_GP(a0)
 #endif
+#ifndef SOFTFLOAT_FOR_GCC
 	# get fpu status
+	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
+#endif
 	REG_L		sp, _OFFSETOF_SC_REGS_SP(a0)
 	REG_L		s8, _OFFSETOF_SC_REGS_S8(a0)
 #ifndef SOFTFLOAT_FOR_GCC
-	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 	ctc1		v0, $31
 	/*
 	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
@@ -183,6 +185,8 @@
 	 * our caller's GP.
 	 */
 	jal	_C_LABEL(longjmperror)
+	 nop
 	
 	PIC_TAILCALL(abort)
+	 nop
 END(_longjmp)