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/arm complete arm's move to the new comp...



details:   https://anonhg.NetBSD.org/src/rev/ce93dc2ac0ec
branches:  trunk
changeset: 585100:ce93dc2ac0ec
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 16 17:27:49 2005 +0000

description:
complete arm's move to the new compat layout.

diffstat:

 lib/libc/compat/arch/arm/Makefile.inc               |    4 +
 lib/libc/compat/arch/arm/gen/Makefile.inc           |    3 +
 lib/libc/compat/arch/arm/gen/compat_setjmp.S        |  130 ++++++++++++++++++++
 lib/libc/compat/arch/arm/gen/compat_sigsetjmp.S     |   61 +++++++++
 lib/libc/compat/arch/arm/sys/Makefile.inc           |    6 +
 lib/libc/compat/arch/arm/sys/compat_Ovfork.S        |   56 ++++++++
 lib/libc/compat/arch/arm/sys/compat___semctl.S      |   42 ++++++
 lib/libc/compat/arch/arm/sys/compat___sigreturn14.S |   40 ++++++
 lib/libc/compat/arch/arm/sys/compat___sigtramp1.S   |   54 ++++++++
 lib/libc/compat/arch/arm/sys/compat_msgctl.S        |   45 ++++++
 lib/libc/compat/arch/arm/sys/compat_shmctl.S        |   45 ++++++
 lib/libc/compat/arch/arm/sys/compat_sigaction.S     |   45 ++++++
 lib/libc/compat/arch/arm/sys/compat_sigpending.S    |   45 ++++++
 lib/libc/compat/arch/arm/sys/compat_sigprocmask.S   |   49 +++++++
 lib/libc/compat/arch/arm/sys/compat_sigreturn.S     |   55 ++++++++
 lib/libc/compat/arch/arm/sys/compat_sigreuteturn.S  |   43 ++++++
 lib/libc/compat/arch/arm/sys/compat_sigsuspend.S    |   44 ++++++
 17 files changed, 767 insertions(+), 0 deletions(-)

diffs (truncated from 835 to 300 lines):

diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/Makefile.inc     Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: Makefile.inc,v 1.1 2005/10/16 17:27:49 christos Exp $
+
+.include "${.CURDIR}/compat/arch/sparc/gen/Makefile.inc"
+.include "${.CURDIR}/compat/arch/sparc/sys/Makefile.inc"
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/gen/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/gen/Makefile.inc Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,3 @@
+#      $NetBSD: Makefile.inc,v 1.1 2005/10/16 17:27:50 christos Exp $
+
+SRCS+= compat_setjmp.S compat_sigsetjmp.S
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/gen/compat_setjmp.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/gen/compat_setjmp.S      Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,130 @@
+/*     $NetBSD: compat_setjmp.S,v 1.1 2005/10/16 17:27:50 christos Exp $       */
+
+/*
+ * Copyright (c) 1997 Mark Brinicombe
+ * All rights reserved.
+ *
+ * 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 Mark Brinicombe
+ * 4. 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 AUTHOR 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 AUTHOR 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>
+#include <machine/setjmp.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 restored.
+ */
+
+ENTRY(setjmp)
+       /* Block all signals and retrieve the old signal mask */
+       stmfd   sp!, {r0, r14}
+       mov     r0, #0x00000000
+
+       bl      PIC_SYM(_C_LABEL(sigblock), PLT)
+       mov     r1, r0
+
+       ldmfd   sp!, {r0, r14}
+
+       /* Store signal mask */
+       str     r1, [r0, #(25 * 4)]
+
+       ldr     r1, .Lsetjmp_magic
+       str     r1, [r0], #4
+
+#ifdef SOFTFLOAT
+       add     r0, r0, #52
+#else
+       /* Store fp registers */
+       sfm     f4, 4, [r0], #48
+       /* Store fpsr */
+       rfs     r1
+       str     r1, [r0], #0x0004
+#endif /*SOFTFLOAT*/
+       /* Store integer registers */
+        stmia  r0, {r4-r14}
+        mov    r0, #0x00000000
+        RET
+
+.Lsetjmp_magic:
+       .word   _JB_MAGIC_SETJMP
+
+
+ENTRY(longjmp)
+       ldr     r2, .Lsetjmp_magic
+       ldr     r3, [r0]
+       teq     r2, r3
+       bne     botch
+
+       /* Fetch signal mask */
+       ldr     r2, [r0, #(25 * 4)]
+
+       /* Set signal mask */
+       stmfd   sp!, {r0, r1, r14}
+       sub     sp, sp, #4      /* align the stack */
+
+       mov     r0, r2
+       bl      PIC_SYM(_C_LABEL(sigsetmask), PLT)
+
+       add     sp, sp, #4      /* unalign the stack */
+       ldmfd   sp!, {r0, r1, r14} 
+
+       add     r0, r0, #4
+#ifdef SOFTFLOAT
+       add     r0, r0, #52
+#else
+       /* Restore fp registers */
+       lfm     f4, 4, [r0], #48
+       /* Restore FPSR */
+       ldr     r4, [r0], #0x0004
+       wfs     r4
+#endif /* SOFTFLOAT */
+       /* Restore integer registers */
+        ldmia  r0, {r4-r14}
+
+       /* Validate sp and r14 */
+       teq     sp, #0
+       teqne   r14, #0
+       beq     botch
+
+       /* Set return value */
+
+       mov     r0, r1
+       teq     r0, #0x00000000
+       moveq   r0, #0x00000001
+       RET
+
+       /* validation failed, die die die. */
+botch:
+       bl      PIC_SYM(_C_LABEL(longjmperror), PLT)
+       bl      PIC_SYM(_C_LABEL(abort), PLT)
+       b       . - 8           /* Cannot get here */
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/gen/compat_sigsetjmp.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/gen/compat_sigsetjmp.S   Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,61 @@
+/*     $NetBSD: compat_sigsetjmp.S,v 1.1 2005/10/16 17:27:50 christos Exp $    */
+
+/*
+ * Copyright (c) 1997 Mark Brinicombe
+ * All rights reserved.
+ *
+ * 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 Mark Brinicombe
+ * 4. 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 AUTHOR 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 AUTHOR 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>
+#include <machine/setjmp.h>
+
+/*
+ * C library -- sigsetjmp, siglongjmp
+ *
+ *     longjmp(a,v)
+ * will generate a "return(v)" from the last call to
+ *     setjmp(a, m)
+ * by restoring registers from the stack.
+ * The previous signal state is restored.
+ */
+
+ENTRY(sigsetjmp)
+       teq     r1, #0
+       beq     PIC_SYM(_C_LABEL(_setjmp), PLT)
+       b       PIC_SYM(_C_LABEL(setjmp), PLT)
+
+.L_setjmp_magic:
+       .word   _JB_MAGIC__SETJMP
+
+ENTRY(siglongjmp)
+       ldr     r2, .L_setjmp_magic
+       ldr     r3, [r0]
+       teq     r2, r3
+       beq     PIC_SYM(_C_LABEL(_longjmp), PLT)
+       b       PIC_SYM(_C_LABEL(longjmp), PLT)
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/sys/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/sys/Makefile.inc Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,6 @@
+#      $NetBSD: Makefile.inc,v 1.1 2005/10/16 17:27:50 christos Exp $
+
+SRCS+=compat_Ovfork.S compat___semctl.S compat___sigreturn14.S \
+    compat___sigtramp1.S compat_msgctl.S compat_shmctl.S compat_sigaction.S \
+    compat_sigpending.S compat_sigprocmask.S compat_sigreturn.S \
+    compat_sigsuspend.S 
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/sys/compat_Ovfork.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/sys/compat_Ovfork.S      Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,56 @@
+/*     $NetBSD: compat_Ovfork.S,v 1.1 2005/10/16 17:27:50 christos Exp $       */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * 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: @(#)Ovfork.s      5.1 (Berkeley) 4/23/90
+ */
+
+#include "SYS.h"
+
+WARN_REFERENCES(vfork, \
+    "warning: reference to compatibility vfork(); include <unistd.h> for correct reference")
+
+/*
+ * pid = vfork();
+ *
+ * On return from the SWI:
+ * r1 == 0 in parent process, r1 == 1 in child process.
+ * r0 == pid of child in parent, r0 == pid of parent in child.
+ */
+       .text
+       .align  0
+
+ENTRY(vfork)
+       mov     r2, r14
+       SYSTRAP(vfork)
+       bcs     PIC_SYM(CERROR, PLT)
+       mov     r14, r2
+       sub     r1, r1, #1      /* r1 == 0xffffffff if parent, 0 if child */
+       and     r0, r0, r1      /* r0 == 0 if child, else unchanged */
+       RET
diff -r b48569b444ae -r ce93dc2ac0ec lib/libc/compat/arch/arm/sys/compat___semctl.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/compat/arch/arm/sys/compat___semctl.S    Sun Oct 16 17:27:49 2005 +0000
@@ -0,0 +1,42 @@
+/*     $NetBSD: compat___semctl.S,v 1.1 2005/10/16 17:27:50 christos Exp $     */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions



Home | Main Index | Thread Index | Old Index