Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/compat/arch/alpha bring the compat code for alpha i...



details:   https://anonhg.NetBSD.org/src/rev/b520ff8d4580
branches:  trunk
changeset: 584421:b520ff8d4580
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Sep 16 18:21:19 2005 +0000

description:
bring the compat code for alpha into place

diffstat:

 lib/libc/compat/arch/alpha/Makefile.inc               |    4 +
 lib/libc/compat/arch/alpha/gen/Makefile.inc           |    3 +
 lib/libc/compat/arch/alpha/gen/compat__setjmp.S       |  123 +++++++++++++++++
 lib/libc/compat/arch/alpha/gen/compat_setjmp.S        |  124 ++++++++++++++++++
 lib/libc/compat/arch/alpha/gen/compat_sigsetjmp.S     |   62 +++++++++
 lib/libc/compat/arch/alpha/sys/Makefile.inc           |    6 +
 lib/libc/compat/arch/alpha/sys/compat_Ovfork.S        |   38 +++++
 lib/libc/compat/arch/alpha/sys/compat___semctl.S      |   42 ++++++
 lib/libc/compat/arch/alpha/sys/compat___sigreturn14.S |   38 +++++
 lib/libc/compat/arch/alpha/sys/compat___sigtramp1.S   |   45 ++++++
 lib/libc/compat/arch/alpha/sys/compat_msgctl.S        |   45 ++++++
 lib/libc/compat/arch/alpha/sys/compat_shmctl.S        |   45 ++++++
 lib/libc/compat/arch/alpha/sys/compat_sigaction.S     |   45 ++++++
 lib/libc/compat/arch/alpha/sys/compat_sigpending.S    |   40 +++++
 lib/libc/compat/arch/alpha/sys/compat_sigprocmask.S   |   47 ++++++
 lib/libc/compat/arch/alpha/sys/compat_sigreturn.S     |   41 +++++
 lib/libc/compat/arch/alpha/sys/compat_sigsuspend.S    |   40 +++++
 17 files changed, 788 insertions(+), 0 deletions(-)

diffs (truncated from 856 to 300 lines):

diff -r bc6bd4c9fa79 -r b520ff8d4580 lib/libc/compat/arch/alpha/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/alpha/Makefile.inc   Fri Sep 16 18:21:19 2005 +0000
@@ -0,0 +1,4 @@
+# $NetBSD: Makefile.inc,v 1.1 2005/09/16 18:21:19 drochner Exp $
+
+.include "${.CURDIR}/compat/arch/alpha/gen/Makefile.inc"
+.include "${.CURDIR}/compat/arch/alpha/sys/Makefile.inc"
diff -r bc6bd4c9fa79 -r b520ff8d4580 lib/libc/compat/arch/alpha/gen/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/alpha/gen/Makefile.inc       Fri Sep 16 18:21:19 2005 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 2005/09/16 18:21:19 drochner Exp $
+
+SRCS+=  compat_setjmp.S compat__setjmp.S compat_sigsetjmp.S
diff -r bc6bd4c9fa79 -r b520ff8d4580 lib/libc/compat/arch/alpha/gen/compat__setjmp.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/alpha/gen/compat__setjmp.S   Fri Sep 16 18:21:19 2005 +0000
@@ -0,0 +1,123 @@
+/* $NetBSD: compat__setjmp.S,v 1.1 2005/09/16 18:21:19 drochner Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ * 
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * 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.
+ */
+
+       .set    noreorder
+
+LEAF(_setjmp, 1)
+       LDGP(pv)
+       stq     ra, (2 * 8)(a0)                 /* sc_pc = return address */
+       stq     s0, (( 9 + 4) * 8)(a0)          /* saved bits of sc_regs */
+       stq     s1, ((10 + 4) * 8)(a0)
+       stq     s2, ((11 + 4) * 8)(a0)
+       stq     s3, ((12 + 4) * 8)(a0)
+       stq     s4, ((13 + 4) * 8)(a0)
+       stq     s5, ((14 + 4) * 8)(a0)
+       stq     s6, ((15 + 4) * 8)(a0)
+       stq     ra, ((26 + 4) * 8)(a0)
+       stq     sp, ((30 + 4) * 8)(a0)
+       ldiq    t0, 0xacedbadd                  /* sigcontext magic number */
+       stq     t0, ((31 + 4) * 8)(a0)          /* magic in sc_regs[31] */
+       /* Too bad we can't check if we actually used FP */
+       ldiq    t0, 1
+       stq     t0, (36 * 8)(a0)                /* say we've used FP.  */
+       stt     fs0, ((2 + 37) * 8)(a0)         /* saved bits of sc_fpregs */
+       stt     fs1, ((3 + 37) * 8)(a0)
+       stt     fs2, ((4 + 37) * 8)(a0)
+       stt     fs3, ((5 + 37) * 8)(a0)
+       stt     fs4, ((6 + 37) * 8)(a0)
+       stt     fs5, ((7 + 37) * 8)(a0)
+       stt     fs6, ((8 + 37) * 8)(a0)
+       stt     fs7, ((9 + 37) * 8)(a0)
+       mf_fpcr ft0                             /* get FP control reg */
+       stt     ft0, (69 * 8)(a0)               /* and store it in sc_fpcr */
+       stq     zero, (70 * 8)(a0)              /* FP software control XXX */
+       stq     zero, (71 * 8)(a0)              /* sc_reserved[0] */
+       stq     zero, (72 * 8)(a0)              /* sc_reserved[1] */
+       stq     zero, (73 * 8)(a0)              /* sc_xxx[0] */
+       stq     zero, (74 * 8)(a0)              /* sc_xxx[1] */
+       stq     zero, (75 * 8)(a0)              /* sc_xxx[2] */
+       stq     zero, (76 * 8)(a0)              /* sc_xxx[3] */
+       stq     zero, (77 * 8)(a0)              /* sc_xxx[4] */
+       stq     zero, (78 * 8)(a0)              /* sc_xxx[5] */
+       stq     zero, (79 * 8)(a0)              /* sc_xxx[6] */
+       stq     zero, (80 * 8)(a0)              /* sc_xxx[7] */
+
+       mov     zero, v0                        /* return zero */
+       RET
+END(_setjmp)
+
+LEAF(_longjmp, 2)
+       LDGP(pv)
+       ldq     t0, ((31 + 4) * 8)(a0)          /* magic in sc_regs[31] */
+       ldiq    t1, 0xacedbadd
+       cmpeq   t0, t1, t0
+       beq     t0, botch                       /* If the magic was bad, punt */
+
+       ldq     ra, (2 * 8)(a0)                 /* sc_pc = return address */
+       ldq     s0, (( 9 + 4) * 8)(a0)          /* saved bits of sc_regs */
+       ldq     s1, ((10 + 4) * 8)(a0)
+       ldq     s2, ((11 + 4) * 8)(a0)
+       ldq     s3, ((12 + 4) * 8)(a0)
+       ldq     s4, ((13 + 4) * 8)(a0)
+       ldq     s5, ((14 + 4) * 8)(a0)
+       ldq     s6, ((15 + 4) * 8)(a0)
+       /* ldq  ra, ((26 + 4) * 8)(a0)          set above */
+       ldq     sp, ((30 + 4) * 8)(a0)
+       ldt     fs0, ((2 + 37) * 8)(a0)         /* saved bits of sc_fpregs */
+       ldt     fs1, ((3 + 37) * 8)(a0)
+       ldt     fs2, ((4 + 37) * 8)(a0)
+       ldt     fs3, ((5 + 37) * 8)(a0)
+       ldt     fs4, ((6 + 37) * 8)(a0)
+       ldt     fs5, ((7 + 37) * 8)(a0)
+       ldt     fs6, ((8 + 37) * 8)(a0)
+       ldt     fs7, ((9 + 37) * 8)(a0)
+       ldt     ft0, (69 * 8)(a0)               /* get sc_fpcr */
+       mt_fpcr ft0                             /* and restore it. */
+
+       mov     a1, v0                          /* return second arg */
+       RET
+
+botch:
+       CALL(longjmperror)
+       CALL(abort)
+       RET                                     /* "can't" get here... */
+END(_longjmp)
diff -r bc6bd4c9fa79 -r b520ff8d4580 lib/libc/compat/arch/alpha/gen/compat_setjmp.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/alpha/gen/compat_setjmp.S    Fri Sep 16 18:21:19 2005 +0000
@@ -0,0 +1,124 @@
+/* $NetBSD: compat_setjmp.S,v 1.1 2005/09/16 18:21:19 drochner Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ * 
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * 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,
+ * and the previous signal state.
+ */
+
+       .set    noreorder
+
+LEAF(setjmp, 1)
+       LDGP(pv)
+       stq     ra, (2 * 8)(a0)                 /* sc_pc = return address */
+       stq     s0, (( 9 + 4) * 8)(a0)          /* saved bits of sc_regs */
+       stq     s1, ((10 + 4) * 8)(a0)
+       stq     s2, ((11 + 4) * 8)(a0)
+       stq     s3, ((12 + 4) * 8)(a0)
+       stq     s4, ((13 + 4) * 8)(a0)
+       stq     s5, ((14 + 4) * 8)(a0)
+       stq     s6, ((15 + 4) * 8)(a0)
+       stq     ra, ((26 + 4) * 8)(a0)
+       stq     sp, ((30 + 4) * 8)(a0)
+
+       /*
+        * get signal information
+        */
+       mov     a0, s0                          /* squirrel away ptr to sc */
+
+       /* see what's blocked */
+       mov     zero, a0
+       CALL(sigblock)                          /* see what's blocked */
+       stq     v0, (1 * 8)(s0)                 /* and remember it in sc_mask */
+
+       lda     sp, -24(sp)                     /* sizeof struct sigaltstack */
+       mov     zero, a0
+       mov     sp, a1
+       CALL(__sigaltstack14)
+       ldl     t0, 16(sp)                      /* offset of ss_flags */
+       lda     sp, 24(sp)                      /* sizeof struct sigaltstack */
+       ldq     ra, ((26 + 4) * 8)(s0)          /* restore return address */
+       blt     v0, botch                       /* check for error */
+       and     t0, 0x1, t0                     /* get SA_ONSTACK flag */
+       stq     t0, (0 * 8)(s0)                 /* and save it in sc_onstack */
+       /*
+        * Restore old s0 and a0, and continue saving registers
+        */
+       mov     s0, a0
+       ldq     s0, (( 9 + 4) * 8)(a0)
+
+       ldiq    t0, 0xacedbade                  /* sigcontext magic number */
+       stq     t0, ((31 + 4) * 8)(a0)          /* magic in sc_regs[31] */
+       /* Too bad we can't check if we actually used FP */
+       ldiq    t0, 1
+       stq     t0, (36 * 8)(a0)                /* say we've used FP.  */
+       stt     fs0, ((2 + 37) * 8)(a0)         /* saved bits of sc_fpregs */
+       stt     fs1, ((3 + 37) * 8)(a0)
+       stt     fs2, ((4 + 37) * 8)(a0)
+       stt     fs3, ((5 + 37) * 8)(a0)
+       stt     fs4, ((6 + 37) * 8)(a0)
+       stt     fs5, ((7 + 37) * 8)(a0)
+       stt     fs6, ((8 + 37) * 8)(a0)
+       stt     fs7, ((9 + 37) * 8)(a0)
+       mf_fpcr ft0                             /* get FP control reg */
+       stt     ft0, (69 * 8)(a0)               /* and store it in sc_fpcr */
+       stq     zero, (70 * 8)(a0)              /* FP software control XXX */
+       stq     zero, (71 * 8)(a0)              /* sc_reserved[0] */
+       stq     zero, (72 * 8)(a0)              /* sc_reserved[1] */
+       stq     zero, (73 * 8)(a0)              /* sc_xxx[0] */
+       stq     zero, (74 * 8)(a0)              /* sc_xxx[1] */
+       stq     zero, (75 * 8)(a0)              /* sc_xxx[2] */
+       stq     zero, (76 * 8)(a0)              /* sc_xxx[3] */
+       stq     zero, (77 * 8)(a0)              /* sc_xxx[4] */
+       stq     zero, (78 * 8)(a0)              /* sc_xxx[5] */
+       stq     zero, (79 * 8)(a0)              /* sc_xxx[6] */
+       stq     zero, (80 * 8)(a0)              /* sc_xxx[7] */
+
+       mov     zero, v0                        /* return zero */
+       RET
+END(setjmp)
+
+LEAF(longjmp, 2)
+       LDGP(pv)
+       stq     a1, (( 0 + 4) * 8)(a0)          /* save return value */
+       CALL(sigreturn)                         /* use sigreturn to return */
+
+botch:
+       CALL(longjmperror)
+       CALL(abort)
+       RET                                     /* "can't" get here... */
+END(longjmp)
diff -r bc6bd4c9fa79 -r b520ff8d4580 lib/libc/compat/arch/alpha/gen/compat_sigsetjmp.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/alpha/gen/compat_sigsetjmp.S Fri Sep 16 18:21:19 2005 +0000
@@ -0,0 +1,62 @@
+/* $NetBSD: compat_sigsetjmp.S,v 1.1 2005/09/16 18:21:19 drochner Exp $ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ * 
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the



Home | Main Index | Thread Index | Old Index