diff --git a/lib/libc/arch/sh3/gen/Makefile.inc b/lib/libc/arch/sh3/gen/Makefile.inc index 916a7f61e048..f77e3dc72cf4 100644 --- a/lib/libc/arch/sh3/gen/Makefile.inc +++ b/lib/libc/arch/sh3/gen/Makefile.inc @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.17 2005/04/15 22:39:11 kleink Exp $ +# $NetBSD: Makefile.inc,v 1.18 2005/09/15 22:44:58 uwe Exp $ -SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S +SRCS+= setjmp.S sigsetjmp.S SRCS+= makecontext.c resumecontext.c swapcontext.S diff --git a/lib/libc/arch/sh3/gen/setjmp.S b/lib/libc/arch/sh3/gen/setjmp.S index bbc0e853623a..baeb6a7bba5c 100644 --- a/lib/libc/arch/sh3/gen/setjmp.S +++ b/lib/libc/arch/sh3/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: setjmp.S,v 1.6 2003/08/07 16:42:19 agc Exp $ */ +/* $NetBSD: setjmp.S,v 1.7 2005/09/15 22:44:58 uwe Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) - RCSID("$NetBSD: setjmp.S,v 1.6 2003/08/07 16:42:19 agc Exp $") + RCSID("$NetBSD: setjmp.S,v 1.7 2005/09/15 22:44:58 uwe Exp $") #endif /* @@ -49,24 +49,28 @@ * The previous signal state is restored. */ -ENTRY(setjmp) +ENTRY(__setjmp14) sts.l pr, @-r15 mov.l r4, @-r15 - mov #0, r4 - mov.l Lsigblock, r0 + mov r4, r6 + mov #1, r4 /* SIG_BLOCK */ + mov #0, r5 + add #4*10, r6 /* &sigmask */ + #ifdef PIC + mov.l L__sigprocmask14r1, r0 bsrf r0 nop -1: +L__sigprocmask14o1: #else + mov.l L__sigprocmask14, r0 jsr @r0 nop #endif + mov.l @r15+, r4 lds.l @r15+, pr - - add #4*11, r4 - mov.l r0, @-r4 /* sigmask */ + add #4*10, r4 mov #1, r0 mov.l r0, @-r4 /* savemask */ mov.l r15, @-r4 @@ -81,26 +85,21 @@ ENTRY(setjmp) rts xor r0, r0 - .align 2 -Lsigblock: -#ifdef PIC - .long _C_LABEL(sigblock)-1b -#else - .long _C_LABEL(sigblock) -#endif - -ENTRY(longjmp) +ENTRY(__longjmp14) mov.l r4, @-r15 mov.l r5, @-r15 - mov r4, r0 - add #4*10, r0 - mov.l @r0, r4 - mov.l Lsigsetmask, r0 + + mov r4, r5 + mov #3, r4 /* SIG_SETMASK */ + add #4*10, r5 /* &sigmask */ + mov #0, r6 #ifdef PIC + mov.l L__sigprocmask14r2, r0 bsrf r0 nop -1: +L__sigprocmask14o2: #else + mov.l L__sigprocmask14, r0 jsr @r0 nop #endif @@ -125,9 +124,12 @@ ENTRY(longjmp) nop .align 2 -Lsigsetmask: #ifdef PIC - .long _C_LABEL(sigsetmask)-1b +L__sigprocmask14r1: + .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o1 +L__sigprocmask14r2: + .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o2 #else - .long _C_LABEL(sigsetmask) +L__sigprocmask14: + .long _C_LABEL(__sigprocmask14) #endif diff --git a/lib/libc/arch/sh3/gen/sigsetjmp.S b/lib/libc/arch/sh3/gen/sigsetjmp.S index 7effb9032999..9345a9b22779 100644 --- a/lib/libc/arch/sh3/gen/sigsetjmp.S +++ b/lib/libc/arch/sh3/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigsetjmp.S,v 1.6 2003/08/07 16:42:19 agc Exp $ */ +/* $NetBSD: sigsetjmp.S,v 1.7 2005/09/15 22:44:58 uwe Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -31,42 +31,44 @@ * 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" + * from: @(#)setjmp.s 5.1 (Berkeley) 4/23/90 */ #include #if defined(LIBC_SCCS) - RCSID("$NetBSD: sigsetjmp.S,v 1.6 2003/08/07 16:42:19 agc Exp $") + RCSID("$NetBSD: sigsetjmp.S,v 1.7 2005/09/15 22:44:58 uwe Exp $") #endif -ENTRY(sigsetjmp) - mov r4, r0 - add #4*9, r0 ! &savemask - mov.l r5, @r0 +ENTRY(__sigsetjmp14) tst r5, r5 bt 1f sts.l pr, @-r15 mov.l r4, @-r15 - mov #0, r4 - mov.l Lsigblock, r0 + mov.l r5, @-r15 + mov r4, r6 + mov #1, r4 /* SIG_BLOCK */ + mov #0, r5 + add #4*10, r6 /* &sigmask */ + #ifdef PIC + mov.l L__sigprocmask14r1, r0 bsrf r0 nop -2: +L__sigprocmask14o1: #else + mov.l L__sigprocmask14, r0 jsr @r0 nop #endif + + mov.l @r15+, r5 mov.l @r15+, r4 lds.l @r15+, pr - mov r4, r1 - add #4*10, r1 - mov.l r0, @r1 - 1: - add #4*9, r4 + add #4*10, r4 + mov.l r5, @-r4 mov.l r15, @-r4 mov.l r14, @-r4 mov.l r13, @-r4 @@ -79,15 +81,7 @@ ENTRY(sigsetjmp) rts xor r0, r0 - .align 2 -Lsigblock: -#ifdef PIC - .long _C_LABEL(sigblock)-2b -#else - .long _C_LABEL(sigblock) -#endif - -ENTRY(siglongjmp) +ENTRY(__siglongjmp14) mov r4, r0 add #4*9, r0 mov.l @r0, r0 @@ -96,15 +90,17 @@ ENTRY(siglongjmp) mov.l r4, @-r15 mov.l r5, @-r15 - mov r4, r0 - add #4*10, r0 - mov.l @r0, r4 - mov.l Lsigsetmask, r0 + mov r4, r5 + mov #3, r4 /* SIG_SETMASK */ + add #4*10, r5 /* &sigmask */ + mov #0, r6 #ifdef PIC + mov.l L__sigprocmask14r2, r0 bsrf r0 nop -2: +L__sigprocmask14o2: #else + mov.l L__sigprocmask14, r0 jsr @r0 nop #endif @@ -112,7 +108,6 @@ ENTRY(siglongjmp) mov.l @r15+, r4 1: - mov r5, r0 lds.l @r4+, pr mov.l @r4+, r8 mov.l @r4+, r9 @@ -122,6 +117,8 @@ ENTRY(siglongjmp) mov.l @r4+, r13 mov.l @r4+, r14 mov.l @r4+, r15 + + mov r5, r0 tst r0, r0 bf .L0 add #1, r0 @@ -130,9 +127,12 @@ ENTRY(siglongjmp) nop .align 2 -Lsigsetmask : #ifdef PIC - .long _C_LABEL(sigsetmask)-2b +L__sigprocmask14r1: + .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o1 +L__sigprocmask14r2: + .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o2 #else - .long _C_LABEL(sigsetmask) +L__sigprocmask14: + .long _C_LABEL(__sigprocmask14) #endif diff --git a/lib/libc/compat/arch/sh3/Makefile.inc b/lib/libc/compat/arch/sh3/Makefile.inc index e892bb7fda21..989ee2cd97f1 100644 --- a/lib/libc/compat/arch/sh3/Makefile.inc +++ b/lib/libc/compat/arch/sh3/Makefile.inc @@ -1,3 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.1 2005/09/15 21:39:16 uwe Exp $ +# $NetBSD: Makefile.inc,v 1.2 2005/09/15 22:44:58 uwe Exp $ +.include "${.CURDIR}/compat/arch/sh3/gen/Makefile.inc" .include "${.CURDIR}/compat/arch/sh3/sys/Makefile.inc" diff --git a/lib/libc/compat/arch/sh3/gen/Makefile.inc b/lib/libc/compat/arch/sh3/gen/Makefile.inc new file mode 100644 index 000000000000..d4345744bc42 --- /dev/null +++ b/lib/libc/compat/arch/sh3/gen/Makefile.inc @@ -0,0 +1,10 @@ +# $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 + +SRCS.compat.sh3.gen=Lint__setjmp.c + +LSRCS+= ${SRCS.compat.sh3.gen} +DPSRCS+= ${SRCS.compat.sh3.gen} +CLEANFILES+= ${SRCS.compat.sh3.gen} diff --git a/lib/libc/arch/sh3/gen/_setjmp.S b/lib/libc/compat/arch/sh3/gen/compat__setjmp.S similarity index 94% rename from lib/libc/arch/sh3/gen/_setjmp.S rename to lib/libc/compat/arch/sh3/gen/compat__setjmp.S index 0b4c7e6e3212..b48ffb483390 100644 --- a/lib/libc/arch/sh3/gen/_setjmp.S +++ b/lib/libc/compat/arch/sh3/gen/compat__setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: _setjmp.S,v 1.2 2003/08/07 16:42:19 agc Exp $ */ +/* $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. @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) - RCSID("$NetBSD: _setjmp.S,v 1.2 2003/08/07 16:42:19 agc Exp $") + RCSID("$NetBSD: compat__setjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $") #endif /* diff --git a/lib/libc/arch/sh3/gen/__setjmp14.S b/lib/libc/compat/arch/sh3/gen/compat_setjmp.S similarity index 79% rename from lib/libc/arch/sh3/gen/__setjmp14.S rename to lib/libc/compat/arch/sh3/gen/compat_setjmp.S index 74f565f14307..05d533b387b5 100644 --- a/lib/libc/arch/sh3/gen/__setjmp14.S +++ b/lib/libc/compat/arch/sh3/gen/compat_setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: __setjmp14.S,v 1.6 2003/08/07 16:42:19 agc Exp $ */ +/* $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. @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) - RCSID("$NetBSD: __setjmp14.S,v 1.6 2003/08/07 16:42:19 agc Exp $") + RCSID("$NetBSD: compat_setjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $") #endif /* @@ -49,28 +49,24 @@ * The previous signal state is restored. */ -ENTRY(__setjmp14) +ENTRY(setjmp) sts.l pr, @-r15 mov.l r4, @-r15 - mov r4, r6 - mov #1, r4 /* SIG_BLOCK */ - mov #0, r5 - add #4*10, r6 /* &sigmask */ - + mov #0, r4 + mov.l Lsigblock, r0 #ifdef PIC - mov.l L__sigprocmask14r1, r0 bsrf r0 nop -L__sigprocmask14o1: +1: #else - mov.l L__sigprocmask14, r0 jsr @r0 nop #endif - mov.l @r15+, r4 lds.l @r15+, pr - add #4*10, r4 + + add #4*11, r4 + mov.l r0, @-r4 /* sigmask */ mov #1, r0 mov.l r0, @-r4 /* savemask */ mov.l r15, @-r4 @@ -85,21 +81,26 @@ L__sigprocmask14o1: rts xor r0, r0 -ENTRY(__longjmp14) + .align 2 +Lsigblock: +#ifdef PIC + .long _C_LABEL(sigblock)-1b +#else + .long _C_LABEL(sigblock) +#endif + +ENTRY(longjmp) mov.l r4, @-r15 mov.l r5, @-r15 - - mov r4, r5 - mov #3, r4 /* SIG_SETMASK */ - add #4*10, r5 /* &sigmask */ - mov #0, r6 + mov r4, r0 + add #4*10, r0 + mov.l @r0, r4 + mov.l Lsigsetmask, r0 #ifdef PIC - mov.l L__sigprocmask14r2, r0 bsrf r0 nop -L__sigprocmask14o2: +1: #else - mov.l L__sigprocmask14, r0 jsr @r0 nop #endif @@ -124,12 +125,9 @@ L__sigprocmask14o2: nop .align 2 +Lsigsetmask: #ifdef PIC -L__sigprocmask14r1: - .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o1 -L__sigprocmask14r2: - .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o2 + .long _C_LABEL(sigsetmask)-1b #else -L__sigprocmask14: - .long _C_LABEL(__sigprocmask14) + .long _C_LABEL(sigsetmask) #endif diff --git a/lib/libc/arch/sh3/gen/__sigsetjmp14.S b/lib/libc/compat/arch/sh3/gen/compat_sigsetjmp.S similarity index 75% rename from lib/libc/arch/sh3/gen/__sigsetjmp14.S rename to lib/libc/compat/arch/sh3/gen/compat_sigsetjmp.S index f5aa16e59989..ad7990740987 100644 --- a/lib/libc/arch/sh3/gen/__sigsetjmp14.S +++ b/lib/libc/compat/arch/sh3/gen/compat_sigsetjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigsetjmp14.S,v 1.6 2003/08/07 16:42:19 agc Exp $ */ +/* $NetBSD: compat_sigsetjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -31,44 +31,42 @@ * 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 + * from: @(#)setjmp.s 5.1 (Berkeley) 4/23/90" */ #include #if defined(LIBC_SCCS) - RCSID("$NetBSD: __sigsetjmp14.S,v 1.6 2003/08/07 16:42:19 agc Exp $") + RCSID("$NetBSD: compat_sigsetjmp.S,v 1.1 2005/09/15 22:44:58 uwe Exp $") #endif -ENTRY(__sigsetjmp14) +ENTRY(sigsetjmp) + mov r4, r0 + add #4*9, r0 ! &savemask + mov.l r5, @r0 tst r5, r5 bt 1f sts.l pr, @-r15 mov.l r4, @-r15 - mov.l r5, @-r15 - mov r4, r6 - mov #1, r4 /* SIG_BLOCK */ - mov #0, r5 - add #4*10, r6 /* &sigmask */ - + mov #0, r4 + mov.l Lsigblock, r0 #ifdef PIC - mov.l L__sigprocmask14r1, r0 bsrf r0 nop -L__sigprocmask14o1: +2: #else - mov.l L__sigprocmask14, r0 jsr @r0 nop #endif - - mov.l @r15+, r5 mov.l @r15+, r4 lds.l @r15+, pr + mov r4, r1 + add #4*10, r1 + mov.l r0, @r1 + 1: - add #4*10, r4 - mov.l r5, @-r4 + add #4*9, r4 mov.l r15, @-r4 mov.l r14, @-r4 mov.l r13, @-r4 @@ -81,7 +79,15 @@ L__sigprocmask14o1: rts xor r0, r0 -ENTRY(__siglongjmp14) + .align 2 +Lsigblock: +#ifdef PIC + .long _C_LABEL(sigblock)-2b +#else + .long _C_LABEL(sigblock) +#endif + +ENTRY(siglongjmp) mov r4, r0 add #4*9, r0 mov.l @r0, r0 @@ -90,17 +96,15 @@ ENTRY(__siglongjmp14) mov.l r4, @-r15 mov.l r5, @-r15 - mov r4, r5 - mov #3, r4 /* SIG_SETMASK */ - add #4*10, r5 /* &sigmask */ - mov #0, r6 + mov r4, r0 + add #4*10, r0 + mov.l @r0, r4 + mov.l Lsigsetmask, r0 #ifdef PIC - mov.l L__sigprocmask14r2, r0 bsrf r0 nop -L__sigprocmask14o2: +2: #else - mov.l L__sigprocmask14, r0 jsr @r0 nop #endif @@ -108,6 +112,7 @@ L__sigprocmask14o2: mov.l @r15+, r4 1: + mov r5, r0 lds.l @r4+, pr mov.l @r4+, r8 mov.l @r4+, r9 @@ -117,8 +122,6 @@ L__sigprocmask14o2: mov.l @r4+, r13 mov.l @r4+, r14 mov.l @r4+, r15 - - mov r5, r0 tst r0, r0 bf .L0 add #1, r0 @@ -127,12 +130,9 @@ L__sigprocmask14o2: nop .align 2 +Lsigsetmask : #ifdef PIC -L__sigprocmask14r1: - .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o1 -L__sigprocmask14r2: - .long _C_LABEL(__sigprocmask14)-L__sigprocmask14o2 + .long _C_LABEL(sigsetmask)-2b #else -L__sigprocmask14: - .long _C_LABEL(__sigprocmask14) + .long _C_LABEL(sigsetmask) #endif