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

2014-07-12 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Jul 12 19:11:57 UTC 2014

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

Log Message:
Use save instruction to set up a local stack frame.

This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.

For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/sparc/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/sparc/gen/_setjmp.S
diff -u src/lib/libc/arch/sparc/gen/_setjmp.S:1.9 src/lib/libc/arch/sparc/gen/_setjmp.S:1.10
--- src/lib/libc/arch/sparc/gen/_setjmp.S:1.9	Sat Apr 30 23:41:12 2011
+++ src/lib/libc/arch/sparc/gen/_setjmp.S	Sat Jul 12 19:11:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.9 2011/04/30 23:41:12 martin Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.10 2014/07/12 19:11:57 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include machine/trap.h
 
 #if defined(LIBC_SCCS)  !defined(lint)
-RCSID($NetBSD: _setjmp.S,v 1.9 2011/04/30 23:41:12 martin Exp $)
+RCSID($NetBSD: _setjmp.S,v 1.10 2014/07/12 19:11:57 nakayama Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -59,26 +59,46 @@ ENTRY(_setjmp)
 	 clr	%o0		! return 0
 
 ENTRY(_longjmp)
-	sub	%sp, 64, %sp	! set up a local stack frame
-	tst	%o1		! compute v ? v : 1
+#ifdef __sparc_v9__
+	save	%sp, -CCFSZ, %sp
+	flushw
+	/*
+	 * We restore the saved stack pointer to %fp, then issue
+	 * a `restore' instruction which will reload the register
+	 * window from the stack.
+	 */
+	ld	[%i0 + 16], %g3
+	ld	[%i0 + 24], %g2
+	ld	[%i0 + 48], %g4
+	ld	[%i0 + 52], %g7
+	ld	[%i0 + 4], %i7	/* restore return pc */
+	ld	[%i0 + 0], %fp	/* and stack pointer */
+	mov	1, %i0
+	movrnz	%i1, %i1, %i0	! compute v ? v : 1
+	ret
+	 restore
+#else
+	save	%sp, -64, %sp	! set up a local stack frame
+	tst	%i1		! compute v ? v : 1
 	be,a	0f
-	 mov	1, %o1
+	 mov	1, %i1
 0:
 	t	ST_FLUSHWIN	! flush register windows out to the stack
 
 	/* restore globals */
-	ld	[%o0 + 16], %g3
-	ld	[%o0 + 24], %g2
-	ld	[%o0 + 48], %g4
-	ld	[%o0 + 52], %g7
+	ld	[%i0 + 16], %g3
+	ld	[%i0 + 24], %g2
+	ld	[%i0 + 48], %g4
+	ld	[%i0 + 52], %g7
 
 	/*
 	 * We restore the saved stack pointer to %fp, then issue
 	 * a `restore' instruction which will reload the register
 	 * window from the stack.
 	 */
-	ld	[%o0+4], %o7	/* restore return pc */
-	ld	[%o0+0], %fp	/* and stack pointer */
+	ld	[%i0+4], %i7	/* restore return pc */
+	ld	[%i0+0], %fp	/* and stack pointer */
 
-	retl			! success, return %o1
-	 restore	%o1, 0, %o0
+	ret			! success, return %i1
+	 restore	%i1, 0, %o0
+#endif



CVS commit: src/lib/libc/arch/sparc

2014-07-12 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Jul 12 19:21:48 UTC 2014

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

Log Message:
Include sparc_v8 library into sparc64 32-bit compat libc library.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/sparc/Makefile.inc
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/arch/sparc/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/sparc/Makefile.inc
diff -u src/lib/libc/arch/sparc/Makefile.inc:1.14 src/lib/libc/arch/sparc/Makefile.inc:1.15
--- src/lib/libc/arch/sparc/Makefile.inc:1.14	Tue Apr 12 03:35:47 2011
+++ src/lib/libc/arch/sparc/Makefile.inc	Sat Jul 12 19:21:48 2014
@@ -1,7 +1,8 @@
-#	$NetBSD: Makefile.inc,v 1.14 2011/04/12 03:35:47 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2014/07/12 19:21:48 nakayama Exp $
 
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 
+.if ${MACHINE} != sparc64
 # `source' files built from m4 source
 # the name `div.o' is taken for the ANSI C `div' function, hence sdiv here
 SRCS+=	rem.S sdiv.S udiv.S urem.S
@@ -34,3 +35,4 @@ urem.S: ${LIBCDIR}/arch/sparc/gen/divrem
 	@(echo define(NAME,\`.urem')define(OP,\`rem')define(S,\`false'); \
 	 cat ${.ALLSRC}) | ${TOOL_M4}  ${.TARGET}
 	@chmod 444 ${.TARGET}
+.endif

Index: src/lib/libc/arch/sparc/gen/Makefile.inc
diff -u src/lib/libc/arch/sparc/gen/Makefile.inc:1.22 src/lib/libc/arch/sparc/gen/Makefile.inc:1.23
--- src/lib/libc/arch/sparc/gen/Makefile.inc:1.22	Sun Dec  6 07:12:17 2009
+++ src/lib/libc/arch/sparc/gen/Makefile.inc	Sat Jul 12 19:21:48 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.22 2009/12/06 07:12:17 uebayasi Exp $
+#	$NetBSD: Makefile.inc,v 1.23 2014/07/12 19:21:48 nakayama Exp $
 
 SRCS+=	fabs.S modf.S
 SRCS+=	flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
@@ -20,7 +20,13 @@ SRCS+=	sigsetjmp.S
 
 SRCS+=	makecontext.c resumecontext.c _lwp.c swapcontext.S
 
-SRCS+=	fixunsdfsi.S mul.S umul.S saveregs.S
+.if ${MACHINE} == sparc64
+.PATH: ${NETBSDSRCDIR}/lib/libarch/sparc/v8
+SRCS+=	sparc_v8.S
+.else
+SRCS+=	mul.S umul.S
+.endif
+SRCS+=	fixunsdfsi.S saveregs.S
 SRCS+=	bswap16.c bswap32.c bswap64.c
 
 LSRCS.sparc.gen=	Lint_swapcontext.c



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

2012-03-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 21 00:34:04 UTC 2012

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

Log Message:
void cast


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sparc/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/sparc/gen/_lwp.c
diff -u src/lib/libc/arch/sparc/gen/_lwp.c:1.6 src/lib/libc/arch/sparc/gen/_lwp.c:1.7
--- src/lib/libc/arch/sparc/gen/_lwp.c:1.6	Wed Feb 23 23:28:43 2011
+++ src/lib/libc/arch/sparc/gen/_lwp.c	Tue Mar 20 20:34:04 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.6 2011/02/24 04:28:43 joerg Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.7 2012/03/21 00:34:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: _lwp.c,v 1.6 2011/02/24 04:28:43 joerg Exp $);
+__RCSID($NetBSD: _lwp.c,v 1.7 2012/03/21 00:34:04 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -53,7 +53,7 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u-uc_stack.ss_size = stack_size;
 
 
-	sp = (ulong *)(stack_base + stack_size);
+	sp = (void *)(stack_base + stack_size);
 	sp = (ulong *)((ulong)sp  ~0x07);
 
 	/* Make room for the fake caller stack frame (CCFSZ, only in words) */



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

2012-03-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 21 00:38:35 UTC 2012

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

Log Message:
c89 prototypes, unsigned int


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sparc/gen/flt_rounds.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/sparc/gen/fpgetmask.c \
src/lib/libc/arch/sparc/gen/fpgetround.c \
src/lib/libc/arch/sparc/gen/fpgetsticky.c \
src/lib/libc/arch/sparc/gen/fpsetmask.c \
src/lib/libc/arch/sparc/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/sparc/gen/flt_rounds.c
diff -u src/lib/libc/arch/sparc/gen/flt_rounds.c:1.6 src/lib/libc/arch/sparc/gen/flt_rounds.c:1.7
--- src/lib/libc/arch/sparc/gen/flt_rounds.c:1.6	Sat Dec 24 18:10:08 2005
+++ src/lib/libc/arch/sparc/gen/flt_rounds.c	Tue Mar 20 20:38:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.7 2012/03/21 00:38:34 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: flt_rounds.c,v 1.6 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: flt_rounds.c,v 1.7 2012/03/21 00:38:34 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include sys/types.h
@@ -21,9 +21,9 @@ static const int map[] = {
 };
 
 int
-__flt_rounds()
+__flt_rounds(void)
 {
-	int x;
+	unsigned int x;
 
 	__asm(st %%fsr,%0 : =m (*x));
 	return map[(x  30)  0x03];

Index: src/lib/libc/arch/sparc/gen/fpgetmask.c
diff -u src/lib/libc/arch/sparc/gen/fpgetmask.c:1.5 src/lib/libc/arch/sparc/gen/fpgetmask.c:1.6
--- src/lib/libc/arch/sparc/gen/fpgetmask.c:1.5	Sat Dec 24 18:10:08 2005
+++ src/lib/libc/arch/sparc/gen/fpgetmask.c	Tue Mar 20 20:38:34 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/21 00:38:34 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 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/21 00:38:34 christos 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;
+	unsigned int x;
 
 	__asm(st %%fsr,%0 : =m (*x));
 	return (x  23)  0x1f;
Index: src/lib/libc/arch/sparc/gen/fpgetround.c
diff -u src/lib/libc/arch/sparc/gen/fpgetround.c:1.5 src/lib/libc/arch/sparc/gen/fpgetround.c:1.6
--- src/lib/libc/arch/sparc/gen/fpgetround.c:1.5	Sat Dec 24 18:10:08 2005
+++ src/lib/libc/arch/sparc/gen/fpgetround.c	Tue Mar 20 20:38:34 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/21 00:38:34 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 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/21 00:38:34 christos 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;
+	unsigned int x;
 
 	__asm(st %%fsr,%0 : =m (*x));
 	return (x  30)  0x03;
Index: src/lib/libc/arch/sparc/gen/fpgetsticky.c
diff -u src/lib/libc/arch/sparc/gen/fpgetsticky.c:1.5 src/lib/libc/arch/sparc/gen/fpgetsticky.c:1.6
--- src/lib/libc/arch/sparc/gen/fpgetsticky.c:1.5	Sat Dec 24 18:10:08 2005
+++ src/lib/libc/arch/sparc/gen/fpgetsticky.c	Tue Mar 20 20:38:34 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/21 00:38:34 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 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/21 00:38:34 christos 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;
+	unsigned int x;
 
 	__asm(st %%fsr,%0 : =m (*x));
 	return (x  5)  0x1f;
Index: src/lib/libc/arch/sparc/gen/fpsetmask.c
diff -u src/lib/libc/arch/sparc/gen/fpsetmask.c:1.5 src/lib/libc/arch/sparc/gen/fpsetmask.c:1.6
--- src/lib/libc/arch/sparc/gen/fpsetmask.c:1.5	Sat Dec 24 18:10:08 2005
+++ src/lib/libc/arch/sparc/gen/fpsetmask.c	Tue Mar 20 20:38:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry 

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

2011-04-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 30 23:41:13 UTC 2011

Modified Files:
src/lib/libc/arch/sparc/gen: _setjmp.S longjmp.c setjmp.S

Log Message:
Save a few global registers during set/longjmp - at least the application
registers and the only currently used system register (%g7).
Sparc now passes the setjmp tests (and should be able to build perl again).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/sparc/gen/_setjmp.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/sparc/gen/longjmp.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/sparc/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/sparc/gen/_setjmp.S
diff -u src/lib/libc/arch/sparc/gen/_setjmp.S:1.8 src/lib/libc/arch/sparc/gen/_setjmp.S:1.9
--- src/lib/libc/arch/sparc/gen/_setjmp.S:1.8	Mon Apr 28 20:22:57 2008
+++ src/lib/libc/arch/sparc/gen/_setjmp.S	Sat Apr 30 23:41:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.8 2008/04/28 20:22:57 martin Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.9 2011/04/30 23:41:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include machine/trap.h
 
 #if defined(LIBC_SCCS)  !defined(lint)
-RCSID($NetBSD: _setjmp.S,v 1.8 2008/04/28 20:22:57 martin Exp $)
+RCSID($NetBSD: _setjmp.S,v 1.9 2011/04/30 23:41:12 martin Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -47,6 +47,12 @@
  */
 
 ENTRY(_setjmp)
+	/* store important globals, sigsetjmp compatible */
+	st	%g3, [%o0 + 16]
+	st	%g2, [%o0 + 24]
+	st	%g4, [%o0 + 48]
+	st	%g7, [%o0 + 52]
+
 	st	%sp, [%o0+0]	/* store caller's stack pointer */
 	st	%o7, [%o0+4]	/* and the return pc */
 	retl
@@ -60,6 +66,12 @@
 0:
 	t	ST_FLUSHWIN	! flush register windows out to the stack
 
+	/* restore globals */
+	ld	[%o0 + 16], %g3
+	ld	[%o0 + 24], %g2
+	ld	[%o0 + 48], %g4
+	ld	[%o0 + 52], %g7
+
 	/*
 	 * We restore the saved stack pointer to %fp, then issue
 	 * a `restore' instruction which will reload the register

Index: src/lib/libc/arch/sparc/gen/longjmp.c
diff -u src/lib/libc/arch/sparc/gen/longjmp.c:1.2 src/lib/libc/arch/sparc/gen/longjmp.c:1.3
--- src/lib/libc/arch/sparc/gen/longjmp.c:1.2	Mon Apr 28 20:22:57 2008
+++ src/lib/libc/arch/sparc/gen/longjmp.c	Sat Apr 30 23:41:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: longjmp.c,v 1.2 2008/04/28 20:22:57 martin Exp $	*/
+/*	$NetBSD: longjmp.c,v 1.3 2011/04/30 23:41:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,11 +35,27 @@
 #include signal.h
 #include stdlib.h
 #include string.h
+#include stddef.h
 
 #define __LIBC12_SOURCE__
 #include setjmp.h
 #include compat/include/setjmp.h
 
+struct __jmp_buf_regs_t {
+	__greg_t	g4;
+	__greg_t	g7;
+	__greg_t	save_mask;
+};
+
+/*
+ * setjmp.S uses hard coded offsets into the jump_buf,
+ * make sure any changes cause a compile failure here
+ */
+__CTASSERT(56 == offsetof(struct __jmp_buf_regs_t,save_mask) +
+	sizeof(struct sigcontext));
+__CTASSERT(sizeof(sigjmp_buf) = sizeof(struct __jmp_buf_regs_t) +
+	sizeof(struct sigcontext));
+
 /*
  * Use setcontext to reload the stack pointer, program counter pc,npc, and
  * set the return value in %o0.  The %i and %l registers will be reloaded
@@ -49,14 +65,15 @@
 __longjmp14(jmp_buf env, int val)
 {
 	struct sigcontext *sc = (void *)env;
+	struct __jmp_buf_regs_t *r = (void*)sc[1];
 	ucontext_t uc;
 
 	/* Ensure non-zero SP */
 	if (sc-sc_sp == 0)
 		goto err;
 
-	/* Initialise the fields we're going to use */
-	uc.uc_link = 0;
+	/* Initialise the context */
+	memset(uc, 0, sizeof(uc));
 
 	/*
 	 * Set _UC_{SET,CLR}STACK according to SS_ONSTACK.
@@ -71,8 +88,12 @@
 	/* Extract PSR, PC, NPC and SP from jmp_buf */
 	uc.uc_mcontext.__gregs[_REG_PSR] = sc-sc_psr;
 	uc.uc_mcontext.__gregs[_REG_PC] = sc-sc_pc;
-	uc.uc_mcontext.__gregs[_REG_nPC] = sc-sc_npc;
+	uc.uc_mcontext.__gregs[_REG_nPC] = sc-sc_pc+4;
 	uc.uc_mcontext.__gregs[_REG_O6] = sc-sc_sp;
+	uc.uc_mcontext.__gregs[_REG_G2] = sc-sc_g1;
+	uc.uc_mcontext.__gregs[_REG_G3] = sc-sc_npc;
+	uc.uc_mcontext.__gregs[_REG_G4] = r-g4;
+	uc.uc_mcontext.__gregs[_REG_G7] = r-g7;
 
 	/* Set the return value; make sure it's non-zero */
 	uc.uc_mcontext.__gregs[_REG_O0] = (val != 0 ? val : 1);

Index: src/lib/libc/arch/sparc/gen/setjmp.S
diff -u src/lib/libc/arch/sparc/gen/setjmp.S:1.11 src/lib/libc/arch/sparc/gen/setjmp.S:1.12
--- src/lib/libc/arch/sparc/gen/setjmp.S:1.11	Mon Oct  8 13:06:00 2007
+++ src/lib/libc/arch/sparc/gen/setjmp.S	Sat Apr 30 23:41:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.S,v 1.11 2007/10/08 13:06:00 uwe Exp $	*/
+/*	$NetBSD: setjmp.S,v 1.12 2011/04/30 23:41:13 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 	.asciz @(#)setjmp.s	8.1 (Berkeley) 6/4/93
 #else
-	RCSID($NetBSD: setjmp.S,v 1.11 2007/10/08 13:06:00 uwe Exp $)
+	RCSID($NetBSD: setjmp.S,v 1.12 2011/04/30 23:41:13 martin Exp $)
 #endif
 #endif /* 

CVS commit: src/lib/libc/arch/sparc

2011-04-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 12 03:35:47 UTC 2011

Modified Files:
src/lib/libc/arch/sparc: Makefile.inc

Log Message:
rm -f ${.TARGET} before trying to  write to it; some how mine ended up
being mode 444 and the build failed.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/sparc/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/sparc/Makefile.inc
diff -u src/lib/libc/arch/sparc/Makefile.inc:1.13 src/lib/libc/arch/sparc/Makefile.inc:1.14
--- src/lib/libc/arch/sparc/Makefile.inc:1.13	Sun Oct 26 07:43:07 2008
+++ src/lib/libc/arch/sparc/Makefile.inc	Tue Apr 12 03:35:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2008/10/26 07:43:07 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2011/04/12 03:35:47 mrg Exp $
 
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 
@@ -9,24 +9,28 @@
 
 sdiv.S: ${LIBCDIR}/arch/sparc/gen/divrem.m4
 	@echo 'building ${.TARGET} from ${.ALLSRC}'
+	@rm -f ${.TARGET}
 	@(echo define(NAME,\`.div')define(OP,\`div')define(S,\`true'); \
 	 cat ${.ALLSRC}) | ${TOOL_M4}  ${.TARGET}
 	@chmod 444 ${.TARGET}
 
 udiv.S: ${LIBCDIR}/arch/sparc/gen/divrem.m4
 	@echo 'building ${.TARGET} from ${.ALLSRC}'
+	@rm -f ${.TARGET}
 	@(echo define(NAME,\`.udiv')define(OP,\`div')define(S,\`false'); \
 	 cat ${.ALLSRC}) | ${TOOL_M4}  ${.TARGET}
 	@chmod 444 ${.TARGET}
 
 rem.S: ${LIBCDIR}/arch/sparc/gen/divrem.m4
 	@echo 'building ${.TARGET} from ${.ALLSRC}'
+	@rm -f ${.TARGET}
 	@(echo define(NAME,\`.rem')define(OP,\`rem')define(S,\`true'); \
 	 cat ${.ALLSRC}) | ${TOOL_M4}  ${.TARGET}
 	@chmod 444 ${.TARGET}
 
 urem.S: ${LIBCDIR}/arch/sparc/gen/divrem.m4
 	@echo 'building ${.TARGET} from ${.ALLSRC}'
+	@rm -f ${.TARGET}
 	@(echo define(NAME,\`.urem')define(OP,\`rem')define(S,\`false'); \
 	 cat ${.ALLSRC}) | ${TOOL_M4}  ${.TARGET}
 	@chmod 444 ${.TARGET}



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

2011-03-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 23 20:54:35 UTC 2011

Modified Files:
src/lib/libc/arch/sparc/gen: divrem.m4

Log Message:
Avoid using %g7


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/sparc/gen/divrem.m4

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/sparc/gen/divrem.m4
diff -u src/lib/libc/arch/sparc/gen/divrem.m4:1.5 src/lib/libc/arch/sparc/gen/divrem.m4:1.6
--- src/lib/libc/arch/sparc/gen/divrem.m4:1.5	Thu Aug  7 16:42:23 2003
+++ src/lib/libc/arch/sparc/gen/divrem.m4	Wed Mar 23 20:54:35 2011
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * from: Header: divrem.m4,v 1.4 92/06/25 13:23:57 torek Exp
- * $NetBSD: divrem.m4,v 1.5 2003/08/07 16:42:23 agc Exp $
+ * $NetBSD: divrem.m4,v 1.6 2011/03/23 20:54:35 martin Exp $
  */
 
 /*
@@ -89,7 +89,7 @@
 
 /* m4 reminder: ifelse(a,b,c,d) = if a is b, then c, else d */
 define(T, `%g1')
-define(SC, `%g7')
+define(SC, `%g5')
 ifelse(S, `true', `define(SIGN, `%g6')')
 
 /*