Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc _setjmp and _longjmp are not compat functions. Noti...
details: https://anonhg.NetBSD.org/src/rev/14d3b8971d7e
branches: trunk
changeset: 585058:14d3b8971d7e
user: uwe <uwe%NetBSD.org@localhost>
date: Sat Oct 15 16:00:42 2005 +0000
description:
_setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes.
diffstat:
lib/libc/arch/sh3/gen/Makefile.inc | 8 +-
lib/libc/arch/sh3/gen/_setjmp.S | 85 +++++++++++++++++++++++++++
lib/libc/compat/arch/sh3/gen/Makefile.inc | 11 +--
lib/libc/compat/arch/sh3/gen/compat__setjmp.S | 85 ---------------------------
4 files changed, 92 insertions(+), 97 deletions(-)
diffs (217 lines):
diff -r e6b01189cf55 -r 14d3b8971d7e lib/libc/arch/sh3/gen/Makefile.inc
--- a/lib/libc/arch/sh3/gen/Makefile.inc Sat Oct 15 15:41:22 2005 +0000
+++ b/lib/libc/arch/sh3/gen/Makefile.inc Sat Oct 15 16:00:42 2005 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.19 2005/09/15 22:49:33 uwe Exp $
+# $NetBSD: Makefile.inc,v 1.20 2005/10/15 16:00:42 uwe Exp $
-SRCS+= setjmp.S sigsetjmp.S
+SRCS+= setjmp.S _setjmp.S sigsetjmp.S
SRCS+= makecontext.c resumecontext.c swapcontext.S
@@ -30,7 +30,9 @@
KMSRCS+= ashiftrt.S ashlsi3.S ashrsi3.S lshrsi3.S movstr.S movstr_i4.S \
movstrSI.S mulsi3.S sdivsi3.S udivsi3.S
-SRCS.sh3.gen= Lint___setjmp14.c Lint___sigsetjmp14.c Lint_swapcontext.c
+SRCS.sh3.gen= Lint__setjmp.c Lint___setjmp14.c Lint___sigsetjmp14.c \
+ Lint_swapcontext.c
+
LSRCS+= ${SRCS.sh3.gen}
DPSRCS+= ${SRCS.sh3.gen}
CLEANFILES+= ${SRCS.sh3.gen}
diff -r e6b01189cf55 -r 14d3b8971d7e lib/libc/arch/sh3/gen/_setjmp.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/gen/_setjmp.S Sat Oct 15 16:00:42 2005 +0000
@@ -0,0 +1,85 @@
+/* $NetBSD: _setjmp.S,v 1.4 2005/10/15 16:00:42 uwe Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)_setjmp.s 5.1 (Berkeley) 4/23/90
+ */
+
+#include <machine/asm.h>
+#if defined(LIBC_SCCS)
+ RCSID("$NetBSD: _setjmp.S,v 1.4 2005/10/15 16:00:42 uwe Exp $")
+#endif
+
+/*
+ * C library -- _setjmp, _longjmp
+ *
+ * _longjmp(a,v)
+ * will generate a "return(v)" from the last call to
+ * _setjmp(a)
+ * by restoring registers from the stack.
+ * The previous signal state is NOT restored.
+ */
+
+ENTRY(_setjmp)
+ add #4*10, r4
+ mov #0, r0
+ mov.l r0, @-r4
+ mov.l r15, @-r4
+ mov.l r14, @-r4
+ mov.l r13, @-r4
+ mov.l r12, @-r4
+ mov.l r11, @-r4
+ mov.l r10, @-r4
+ mov.l r9, @-r4
+ mov.l r8, @-r4
+ sts.l pr, @-r4
+ rts
+ xor r0, r0
+
+ENTRY(_longjmp)
+ lds.l @r4+, pr
+ mov.l @r4+, r8
+ mov.l @r4+, r9
+ mov.l @r4+, r10
+ mov.l @r4+, r11
+ mov.l @r4+, r12
+ mov.l @r4+, r13
+ mov.l @r4+, r14
+ mov.l @r4+, r15
+
+ mov r5, r0
+ tst r0, r0
+ bf .L0
+ add #1, r0
+.L0:
+ rts
+ nop
diff -r e6b01189cf55 -r 14d3b8971d7e lib/libc/compat/arch/sh3/gen/Makefile.inc
--- a/lib/libc/compat/arch/sh3/gen/Makefile.inc Sat Oct 15 15:41:22 2005 +0000
+++ b/lib/libc/compat/arch/sh3/gen/Makefile.inc Sat Oct 15 16:00:42 2005 +0000
@@ -1,10 +1,3 @@
-# $NetBSD: Makefile.inc,v 1.1 2005/09/15 22:44:58 uwe Exp $
-
-# objects built from assembler sources (need lint stubs)
-SRCS+= compat_setjmp.S compat__setjmp.S compat_sigsetjmp.S
+# $NetBSD: Makefile.inc,v 1.2 2005/10/15 16:00:42 uwe Exp $
-SRCS.compat.sh3.gen=Lint__setjmp.c
-
-LSRCS+= ${SRCS.compat.sh3.gen}
-DPSRCS+= ${SRCS.compat.sh3.gen}
-CLEANFILES+= ${SRCS.compat.sh3.gen}
+SRCS+= compat_setjmp.S compat_sigsetjmp.S
diff -r e6b01189cf55 -r 14d3b8971d7e lib/libc/compat/arch/sh3/gen/compat__setjmp.S
--- a/lib/libc/compat/arch/sh3/gen/compat__setjmp.S Sat Oct 15 15:41:22 2005 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/* $NetBSD: compat__setjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $ */
-
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)_setjmp.s 5.1 (Berkeley) 4/23/90
- */
-
-#include <machine/asm.h>
-#if defined(LIBC_SCCS)
- RCSID("$NetBSD: compat__setjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $")
-#endif
-
-/*
- * C library -- _setjmp, _longjmp
- *
- * _longjmp(a,v)
- * will generate a "return(v)" from the last call to
- * _setjmp(a)
- * by restoring registers from the stack.
- * The previous signal state is NOT restored.
- */
-
-ENTRY(_setjmp)
- add #4*10, r4
- mov #0, r0
- mov.l r0, @-r4
- mov.l r15, @-r4
- mov.l r14, @-r4
- mov.l r13, @-r4
- mov.l r12, @-r4
- mov.l r11, @-r4
- mov.l r10, @-r4
- mov.l r9, @-r4
- mov.l r8, @-r4
- sts.l pr, @-r4
- rts
- xor r0, r0
-
-ENTRY(_longjmp)
- lds.l @r4+, pr
- mov.l @r4+, r8
- mov.l @r4+, r9
- mov.l @r4+, r10
- mov.l @r4+, r11
- mov.l @r4+, r12
- mov.l @r4+, r13
- mov.l @r4+, r14
- mov.l @r4+, r15
-
- mov r5, r0
- tst r0, r0
- bf .L0
- add #1, r0
-.L0:
- rts
- nop
Home |
Main Index |
Thread Index |
Old Index