Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/hppa Changes to allow libc to compile as PIC o...



details:   https://anonhg.NetBSD.org/src/rev/faa86f0f2fc6
branches:  trunk
changeset: 533472:faa86f0f2fc6
user:      fredette <fredette%NetBSD.org@localhost>
date:      Mon Jul 01 16:00:50 2002 +0000

description:
Changes to allow libc to compile as PIC on the hppa.

diffstat:

 lib/libc/arch/hppa/SYS.h             |  16 ++++++-
 lib/libc/arch/hppa/gen/Makefile.inc  |   4 +-
 lib/libc/arch/hppa/gen/__setjmp14.S  |   8 +-
 lib/libc/arch/hppa/gen/sigsetjmp.S   |  74 ----------------------------------
 lib/libc/arch/hppa/sys/__clone.S     |   5 +-
 lib/libc/arch/hppa/sys/__vfork14.S   |   5 +-
 lib/libc/arch/hppa/sys/brk.S         |  25 ++++++++--
 lib/libc/arch/hppa/sys/ptrace.S      |   5 +-
 lib/libc/arch/hppa/sys/sbrk.S        |  20 +++++++-
 lib/libc/arch/hppa/sys/setlogin.S    |  14 +++--
 lib/libc/arch/hppa/sys/sigpending.S  |  64 ++++++++++++++++-------------
 lib/libc/arch/hppa/sys/sigprocmask.S |  77 +++++++++++++++--------------------
 lib/libc/arch/hppa/sys/sigreturn.S   |  62 +++++++++++++++++-----------
 lib/libc/arch/hppa/sys/sigsuspend.S  |  65 ++++++++++++++++-------------
 14 files changed, 210 insertions(+), 234 deletions(-)

diffs (truncated from 711 to 300 lines):

diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/SYS.h
--- a/lib/libc/arch/hppa/SYS.h  Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/SYS.h  Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: SYS.h,v 1.1 2002/06/06 20:31:20 fredette Exp $ */
+/*     $NetBSD: SYS.h,v 1.2 2002/07/01 16:00:50 fredette Exp $ */
 
 /*     $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $ */
 
@@ -49,12 +49,22 @@
        ldi     __CONCAT(SYS_,x), t1            !\
        ldw     HPPA_FRAME_ERP(sr0,sp), rp
 
+#ifdef PIC
+#define        __SYSCALL_ERRNO                         !\
+       addil   LT%errno, %r19                  !\
+       ldw     RT%errno(%r1), %r1              !\
+       stw     t1, 0(%r1)
+#else
+#define        __SYSCALL_ERRNO                         !\
+       ldil    L%errno, %r1                    !\
+       stw     t1, R%errno(%r1)
+#endif
+
 #define        __SYSCALL(p,x)                          !\
        .import errno, data                     !\
        __SYSCALL_NOERROR(p,x)                  !\
        comb,=,n r0, t1, __CONCAT(x,$noerr)     !\
-       ldil    L%errno, r1                     !\
-       stw     t1, R%errno(r1)                 !\
+       __SYSCALL_ERRNO                         !\
        ldi     -1, ret0                        !\
        bv      r0(rp)                          !\
        ldi     -1, ret1                        !\
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/gen/Makefile.inc
--- a/lib/libc/arch/hppa/gen/Makefile.inc       Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/gen/Makefile.inc       Mon Jul 01 16:00:50 2002 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile.inc,v 1.1 2002/06/06 20:31:21 fredette Exp $
+#      $NetBSD: Makefile.inc,v 1.2 2002/07/01 16:00:51 fredette Exp $
 
 #      $OpenBSD: Makefile.inc,v 1.2 1999/09/14 00:21:15 mickey Exp $
 
 SRCS+= isnan.c isinf.c infinity.c ldexp.c \
        bswap16.c bswap32.c bswap64.c \
-       __sigsetjmp14.S sigsetjmp.S __setjmp14.S _setjmp.S
+       __sigsetjmp14.S __setjmp14.S _setjmp.S
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/gen/__setjmp14.S
--- a/lib/libc/arch/hppa/gen/__setjmp14.S       Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/gen/__setjmp14.S       Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __setjmp14.S,v 1.1 2002/06/06 20:31:21 fredette Exp $  */
+/*     $NetBSD: __setjmp14.S,v 1.2 2002/07/01 16:00:51 fredette Exp $  */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
 #include <machine/psl.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: __setjmp14.S,v 1.1 2002/06/06 20:31:21 fredette Exp $")
+       RCSID("$NetBSD: __setjmp14.S,v 1.2 2002/07/01 16:00:51 fredette Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -117,8 +117,8 @@
        /* Recover our jmp_buf and extract SS_ONSTACK */
        ldw     HPPA_FRAME_ARG(0)(%r3), %arg0
        ldw     12(%r3), %r1            ; get ss_flags
-       ldi     1, %r19                 ; SS_ONSTACK
-       and     %r1, %r19, %r1
+       ldi     1, %r20                 ; SS_ONSTACK
+       and     %r1, %r20, %r1
        stw     %r1, 0(%arg0)           ; sc.sc_onstack
        
        /* Get the signal mask. */
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/gen/sigsetjmp.S
--- a/lib/libc/arch/hppa/gen/sigsetjmp.S        Mon Jul 01 15:56:41 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*     $NetBSD: sigsetjmp.S,v 1.1 2002/06/06 20:31:21 fredette Exp $   */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Matthew Fredette.
- *
- * 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. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the NetBSD
- *      Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
- */
-
-#include <machine/asm.h>
-
-#if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: sigsetjmp.S,v 1.1 2002/06/06 20:31:21 fredette Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * C library -- sigsetjmp, siglongjmp
- *
- *     siglongjmp(a,v)
- * will generate a "return(v)" from
- * the last call to
- *     sigsetjmp(a,m)
- * by restoring registers from the stack,
- * The previous signal state is restored if 'm' was non-zero.
- */
-
-/* grab _JBLEN */
-#include <machine/setjmp.h>
-
-ENTRY(sigsetjmp,0)
-       stw     %arg1, (_JBLEN * 4)(%arg0)      ; save mask at end of area
-       add,<>  %r0, %arg0, %r0
-       b,n     _setjmp
-       b,n     setjmp
-EXIT(sigsetjmp)
-
-
-ENTRY(siglongjmp,0)
-       ldw     (_JBLEN * 4)(%arg0), %r1
-       add,<>  %r0, %r1, %r0
-       b,n     _longjmp
-       b,n     longjmp
-EXIT(siglongjmp)
-
-       .end
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/sys/__clone.S
--- a/lib/libc/arch/hppa/sys/__clone.S  Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/sys/__clone.S  Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __clone.S,v 1.1 2002/06/06 20:31:23 fredette Exp $     */
+/*     $NetBSD: __clone.S,v 1.2 2002/07/01 16:00:52 fredette Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -51,8 +51,7 @@
 /* XXX - this is unimplemented at this time. */
 ENTRY(__clone, 0)
        ldi     EINVAL, t1
-        ldil    L%errno, r1
-        stw     t1, R%errno(r1)
+       __SYSCALL_ERRNO
         ldi     -1, ret0
         bv      r0(rp)
         ldi     -1, ret1
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/sys/__vfork14.S
--- a/lib/libc/arch/hppa/sys/__vfork14.S        Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/sys/__vfork14.S        Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __vfork14.S,v 1.1 2002/06/06 20:31:23 fredette Exp $   */
+/*     $NetBSD: __vfork14.S,v 1.2 2002/07/01 16:00:52 fredette Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,8 +68,7 @@
        ldi     SYS___vfork14, t1
        copy    t4, rp
        comb,=,n r0, t1, __vfork14$noerr
-       ldil    L%errno, r1
-       stw     t1, R%errno(r1)
+       __SYSCALL_ERRNO
        ldi     -1, ret0
        bv      r0(rp)
        ldi     -1, ret1
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/sys/brk.S
--- a/lib/libc/arch/hppa/sys/brk.S      Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/sys/brk.S      Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brk.S,v 1.1 2002/06/06 20:31:23 fredette Exp $ */
+/*     $NetBSD: brk.S,v 1.2 2002/07/01 16:00:52 fredette Exp $ */
 
 /*     $OpenBSD: brk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $  */
 
@@ -36,7 +36,7 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: brk.S,v 1.1 2002/06/06 20:31:23 fredette Exp $")
+       RCSID("$NetBSD: brk.S,v 1.2 2002/07/01 16:00:52 fredette Exp $")
 #endif /* LIBC_SCCS and not lint */
 
        .import curbrk, data
@@ -47,13 +47,19 @@
 #endif
 
        .data
-       .export minbrk, data
-minbrk
+       .export __minbrk, data
+__minbrk
        .long   end
 
 ENTRY(_brk,0)
-       ldil    L%minbrk, t1
-       ldw     R%minbrk(t1), t2
+#ifdef PIC
+       addil   LT%__minbrk, %r19
+       ldw     RT%__minbrk(%r1), %r1
+       ldw     0(%r1), t2
+#else  /* !PIC */
+       ldil    L%__minbrk, t1
+       ldw     R%__minbrk(t1), t2
+#endif /* !PIC */
        sub,<<  t2, arg0, r0
        copy    t2, arg0
        stw     arg0, HPPA_FRAME_ARG(0)(sp)
@@ -61,9 +67,16 @@
        SYSCALL(break)
 
        ldw     HPPA_FRAME_ARG(0)(sp), arg0
+#ifdef PIC
+       addil   LT%curbrk, %r19
+       ldw     RT%curbrk(%r1), %r1
+       bv      r0(rp)
+       stw     arg0, 0(r1)
+#else  /* !PIC */
        ldil    L%curbrk, t1
        bv      r0(rp)
        stw     arg0, R%curbrk(t1)
+#endif /* !PIC */
 EXIT(brk)
 
        .end
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/sys/ptrace.S
--- a/lib/libc/arch/hppa/sys/ptrace.S   Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/sys/ptrace.S   Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptrace.S,v 1.1 2002/06/06 20:31:23 fredette Exp $      */
+/*     $NetBSD: ptrace.S,v 1.2 2002/07/01 16:00:52 fredette Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,8 +44,7 @@
 /* XXX - this is unimplemented at this time. */
 ENTRY(ptrace, 0)
        ldi     EINVAL, t1
-        ldil    L%errno, r1
-        stw     t1, R%errno(r1)
+       __SYSCALL_ERRNO
         ldi     -1, ret0
         bv      r0(rp)
         ldi     -1, ret1
diff -r cf49c6ed76c4 -r faa86f0f2fc6 lib/libc/arch/hppa/sys/sbrk.S
--- a/lib/libc/arch/hppa/sys/sbrk.S     Mon Jul 01 15:56:41 2002 +0000
+++ b/lib/libc/arch/hppa/sys/sbrk.S     Mon Jul 01 16:00:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbrk.S,v 1.1 2002/06/06 20:31:23 fredette Exp $        */
+/*     $NetBSD: sbrk.S,v 1.2 2002/07/01 16:00:52 fredette Exp $        */
 
 /*     $OpenBSD: sbrk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $ */
 
@@ -36,7 +36,7 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: sbrk.S,v 1.1 2002/06/06 20:31:23 fredette Exp $")
+       RCSID("$NetBSD: sbrk.S,v 1.2 2002/07/01 16:00:52 fredette Exp $")
 #endif /* LIBC_SCCS and not lint */
 
        .import end, data
@@ -51,18 +51,30 @@
        .long   end
 
 ENTRY(_sbrk,0)
+#ifdef PIC
+       addil   LT%curbrk, %r19
+       ldw     RT%curbrk(%r1), %r1
+       ldw     0(%r1), t2
+#else  /* !PIC */
        ldil    L%curbrk, t1
        ldw     R%curbrk(t1), t2
+#endif /* !PIC */



Home | Main Index | Thread Index | Old Index