Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/sh3 libc for SH3.



details:   https://anonhg.NetBSD.org/src/rev/4cba38f89624
branches:  trunk
changeset: 480151:4cba38f89624
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Jan 05 14:07:29 2000 +0000

description:
libc for SH3.
TODO: fplib

diffstat:

 lib/libc/arch/sh3/Makefile.inc        |    8 +
 lib/libc/arch/sh3/SYS.h               |  102 ++++++++++++++++++++++
 lib/libc/arch/sh3/gen/Makefile.inc    |   14 +++
 lib/libc/arch/sh3/gen/__setjmp14.S    |  118 +++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/__sigsetjmp14.S |  121 ++++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/_setjmp.S       |   89 +++++++++++++++++++
 lib/libc/arch/sh3/gen/ashiftrt.S      |  154 +++++++++++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/ashlsi3.S       |   35 +++++++
 lib/libc/arch/sh3/gen/ashrsi3.S       |   43 +++++++++
 lib/libc/arch/sh3/gen/fabs.c          |   48 ++++++++++
 lib/libc/arch/sh3/gen/flt_rounds.c    |   78 +++++++++++++++++
 lib/libc/arch/sh3/gen/fpgetmask.c     |   69 +++++++++++++++
 lib/libc/arch/sh3/gen/fpgetround.c    |   69 +++++++++++++++
 lib/libc/arch/sh3/gen/fpgetsticky.c   |   69 +++++++++++++++
 lib/libc/arch/sh3/gen/fpsetmask.c     |   74 ++++++++++++++++
 lib/libc/arch/sh3/gen/fpsetround.c    |   74 ++++++++++++++++
 lib/libc/arch/sh3/gen/fpsetsticky.c   |   74 ++++++++++++++++
 lib/libc/arch/sh3/gen/frexp.c         |   68 ++++++++++++++
 lib/libc/arch/sh3/gen/infinity.c      |   13 ++
 lib/libc/arch/sh3/gen/isinf.c         |   68 ++++++++++++++
 lib/libc/arch/sh3/gen/isnan.c         |   68 ++++++++++++++
 lib/libc/arch/sh3/gen/ldexp.c         |  155 ++++++++++++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/lshrsi3.S       |   43 +++++++++
 lib/libc/arch/sh3/gen/modf.c          |  104 ++++++++++++++++++++++
 lib/libc/arch/sh3/gen/movstr.S        |   91 +++++++++++++++++++
 lib/libc/arch/sh3/gen/mulsi3.S        |   35 +++++++
 lib/libc/arch/sh3/gen/sdivsi3.S       |   93 ++++++++++++++++++++
 lib/libc/arch/sh3/gen/setjmp.S        |  117 +++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/sigsetjmp.S     |  122 ++++++++++++++++++++++++++
 lib/libc/arch/sh3/gen/udivsi3.S       |   86 ++++++++++++++++++
 lib/libc/arch/sh3/net/Makefile.inc    |    3 +
 lib/libc/arch/sh3/net/htonl.c         |   60 +++++++++++++
 lib/libc/arch/sh3/net/htons.c         |   56 ++++++++++++
 lib/libc/arch/sh3/net/ntohl.c         |   60 +++++++++++++
 lib/libc/arch/sh3/net/ntohs.c         |   56 ++++++++++++
 lib/libc/arch/sh3/stdlib/Makefile.inc |    3 +
 lib/libc/arch/sh3/string/Makefile.inc |    6 +
 lib/libc/arch/sh3/sys/Ovfork.S        |   73 ++++++++++++++++
 lib/libc/arch/sh3/sys/__sigreturn14.S |   54 +++++++++++
 lib/libc/arch/sh3/sys/__vfork14.S     |   75 ++++++++++++++++
 lib/libc/arch/sh3/sys/brk.S           |   84 ++++++++++++++++++
 lib/libc/arch/sh3/sys/cerror.S        |   60 +++++++++++++
 lib/libc/arch/sh3/sys/exect.S         |   74 ++++++++++++++++
 lib/libc/arch/sh3/sys/fork.S          |   70 +++++++++++++++
 lib/libc/arch/sh3/sys/pipe.S          |   55 ++++++++++++
 lib/libc/arch/sh3/sys/ptrace.S        |   67 ++++++++++++++
 lib/libc/arch/sh3/sys/sbrk.S          |   79 +++++++++++++++++
 lib/libc/arch/sh3/sys/setlogin.S      |   58 ++++++++++++
 lib/libc/arch/sh3/sys/sigaction.S     |   45 +++++++++
 lib/libc/arch/sh3/sys/sigpending.S    |   56 ++++++++++++
 lib/libc/arch/sh3/sys/sigprocmask.S   |   81 +++++++++++++++++
 lib/libc/arch/sh3/sys/sigreturn.S     |   55 ++++++++++++
 lib/libc/arch/sh3/sys/sigsuspend.S    |   67 ++++++++++++++
 lib/libc/arch/sh3/sys/syscall.S       |   63 +++++++++++++
 54 files changed, 3662 insertions(+), 0 deletions(-)

diffs (truncated from 3880 to 300 lines):

diff -r 11f3a48b65a4 -r 4cba38f89624 lib/libc/arch/sh3/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/Makefile.inc    Wed Jan 05 14:07:29 2000 +0000
@@ -0,0 +1,8 @@
+#      $NetBSD: Makefile.inc,v 1.1 2000/01/05 14:07:29 msaitoh Exp $
+
+KMINCLUDES=    arch/sh3/SYS.h
+CPPFLAGS+=      -DSOFTFLOAT
+
+.include <fplib/Makefile.inc>
+#KMSRCS=       bcmp.S bzero.S ffs.S strcat.S strcmp.S strcpy.S strlen.S \
+#      htonl.S htons.S ntohl.S ntohs.S
diff -r 11f3a48b65a4 -r 4cba38f89624 lib/libc/arch/sh3/SYS.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/SYS.h   Wed Jan 05 14:07:29 2000 +0000
@@ -0,0 +1,102 @@
+/*-
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 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 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: @(#)SYS.h 5.5 (Berkeley) 5/7/91
+ *     $NetBSD: SYS.h,v 1.1 2000/01/05 14:07:30 msaitoh Exp $
+ */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+#define SYSTRAP(x)                                     \
+               mov.l   903f, r0;                       \
+               .long   0xc380; /* trapa #0x80 */       \
+               nop;                                    \
+               bra     904f;                           \
+               nop;                                    \
+               .align  2;                              \
+       903:    .long   (SYS_ ## x);                    \
+       904:
+#else
+#define SYSTRAP(x)                                     \
+               mov.l   903f, r0;                       \
+               trapa   #0x80;                          \
+               nop;                                    \
+               bra     904f;                           \
+               nop;                                    \
+               .align  2;                              \
+       903:    .long   (SYS_/**/x);                    \
+       904:
+#endif
+
+#define _SYSCALL_NOERROR(x,y)                          \
+               ENTRY(x);                               \
+               SYSTRAP(y)
+
+#define _SYSCALL(x,y)                                  \
+               .text;                                  \
+       911:    mov.l   912f, r3;                       \
+               jmp     @r3;                            \
+               nop;                                    \
+               .align  2;                              \
+       912:    .long   cerror;                         \
+               _SYSCALL_NOERROR(x,y);                  \
+               bf      911b;                           \
+               nop
+
+#define SYSCALL_NOERROR(x)                             \
+               _SYSCALL_NOERROR(x,x)
+
+#define SYSCALL(x)                                     \
+               _SYSCALL(x,x)
+
+#define PSEUDO_NOERROR(x,y)                            \
+               _SYSCALL_NOERROR(x,y);                  \
+               rts;                                    \
+               nop
+
+#define PSEUDO(x,y)                                    \
+               _SYSCALL(x,y);                          \
+               rts;                                    \
+               nop
+
+#define RSYSCALL_NOERROR(x)                            \
+               PSEUDO_NOERROR(x,x)
+
+#define RSYSCALL(x)                                    \
+               PSEUDO(x,x)
+
+       .globl  cerror
diff -r 11f3a48b65a4 -r 4cba38f89624 lib/libc/arch/sh3/gen/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/gen/Makefile.inc        Wed Jan 05 14:07:29 2000 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: Makefile.inc,v 1.1 2000/01/05 14:07:30 msaitoh Exp $
+
+SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
+
+SRCS+= fabs.c flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c \
+       fpsetmask.c fpsetround.c fpsetsticky.c frexp.c infinity.c \
+       isinf.c isnan.c ldexp.c modf.c \
+       bswap16.c bswap32.c bswap64.c
+
+SRCS+= ashiftrt.S ashlsi3.S ashrsi3.S lshrsi3.S movstr.S mulsi3.S \
+       sdivsi3.S udivsi3.S
+
+KMSRCS+= ashiftrt.S ashlsi3.S ashrsi3.S lshrsi3.S movstr.S mulsi3.S \
+       sdivsi3.S udivsi3.S
diff -r 11f3a48b65a4 -r 4cba38f89624 lib/libc/arch/sh3/gen/__setjmp14.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/gen/__setjmp14.S        Wed Jan 05 14:07:29 2000 +0000
@@ -0,0 +1,118 @@
+/*     $NetBSD: __setjmp14.S,v 1.1 2000/01/05 14:07:31 msaitoh 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 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 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: __setjmp14.S,v 1.1 2000/01/05 14:07:31 msaitoh 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 restored.
+ */
+
+ENTRY(__setjmp14)
+       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.l   L__sigprocmask14, r0
+       jsr     @r0
+       nop
+
+       mov.l   @r15+, r4
+       lds.l   @r15+, pr
+       add     #4*10, r4
+       mov     #1, r0
+       mov.l   r0, @-r4        # savemask
+       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(__longjmp14)
+       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.l   L__sigprocmask14, r0
+       jsr     @r0
+       nop
+       mov.l   @r15+, r5
+       mov.l   @r15+, r4
+
+       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
+
+       .align  2
+L__sigprocmask14:
+       .long   ___sigprocmask14
diff -r 11f3a48b65a4 -r 4cba38f89624 lib/libc/arch/sh3/gen/__sigsetjmp14.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/gen/__sigsetjmp14.S     Wed Jan 05 14:07:29 2000 +0000
@@ -0,0 +1,121 @@
+/*     $NetBSD: __sigsetjmp14.S,v 1.1 2000/01/05 14:07:31 msaitoh 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 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 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



Home | Main Index | Thread Index | Old Index