summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorrahnds <rahnds@openbsd.org>1997-03-25 17:06:34 +0000
committerrahnds <rahnds@openbsd.org>1997-03-25 17:06:34 +0000
commit7f7ae0fd385af19d2c0439d121453b7fd9e658d1 (patch)
treeb0b681268678323dfc5bf8e3a7cdbf94b3e819af /lib/libc
parentFixed obj-dir building, compacted the bootblock enough to fit (at least) (diff)
downloadwireguard-openbsd-7f7ae0fd385af19d2c0439d121453b7fd9e658d1.tar.xz
wireguard-openbsd-7f7ae0fd385af19d2c0439d121453b7fd9e658d1.zip
Ok here is the mvme88k userland, minus a few important pieces.
as, ld change need to be merged. It is known that shared libraries and C++ do not work. If anyone wants to step forward and take over the mvme88k port please do. It was dumped on me when the original developer, Nivas, left his previous job and started a new one. I am trying to get the port in a shape that someone could take over.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/arch/mvme88k/DEFS.h3
-rw-r--r--lib/libc/arch/mvme88k/Makefile.inc6
-rw-r--r--lib/libc/arch/mvme88k/SYS.h79
-rw-r--r--lib/libc/arch/mvme88k/gen/Makefile.inc12
-rw-r--r--lib/libc/arch/mvme88k/gen/_setjmp.S32
-rw-r--r--lib/libc/arch/mvme88k/gen/fabs.S14
-rw-r--r--lib/libc/arch/mvme88k/gen/flt_rounds.c23
-rw-r--r--lib/libc/arch/mvme88k/gen/fpgetmask.c16
-rw-r--r--lib/libc/arch/mvme88k/gen/fpgetround.c16
-rw-r--r--lib/libc/arch/mvme88k/gen/fpgetsticky.c16
-rw-r--r--lib/libc/arch/mvme88k/gen/fpsetmask.c25
-rw-r--r--lib/libc/arch/mvme88k/gen/fpsetround.c25
-rw-r--r--lib/libc/arch/mvme88k/gen/fpsetsticky.c25
-rw-r--r--lib/libc/arch/mvme88k/gen/frexp.c79
-rw-r--r--lib/libc/arch/mvme88k/gen/infinity.c10
-rw-r--r--lib/libc/arch/mvme88k/gen/isinf.c65
-rw-r--r--lib/libc/arch/mvme88k/gen/isnan.c55
-rw-r--r--lib/libc/arch/mvme88k/gen/ldexp.c148
-rw-r--r--lib/libc/arch/mvme88k/gen/modf.c309
-rw-r--r--lib/libc/arch/mvme88k/gen/setjmp.S39
-rw-r--r--lib/libc/arch/mvme88k/gen/sigsetjmp.S43
-rw-r--r--lib/libc/arch/mvme88k/net/Makefile.inc3
-rw-r--r--lib/libc/arch/mvme88k/net/htonl.S49
-rw-r--r--lib/libc/arch/mvme88k/net/htons.S50
-rw-r--r--lib/libc/arch/mvme88k/net/ntohl.S49
-rw-r--r--lib/libc/arch/mvme88k/net/ntohs.S50
-rw-r--r--lib/libc/arch/mvme88k/string/Makefile.inc12
-rw-r--r--lib/libc/arch/mvme88k/string/strchr.c13
-rw-r--r--lib/libc/arch/mvme88k/string/strrchr.c13
-rw-r--r--lib/libc/arch/mvme88k/sys/Ovfork.S54
-rw-r--r--lib/libc/arch/mvme88k/sys/brk.S70
-rw-r--r--lib/libc/arch/mvme88k/sys/cerror.S54
-rw-r--r--lib/libc/arch/mvme88k/sys/exect.S50
-rw-r--r--lib/libc/arch/mvme88k/sys/fork.S54
-rw-r--r--lib/libc/arch/mvme88k/sys/pipe.S55
-rw-r--r--lib/libc/arch/mvme88k/sys/ptrace.S55
-rw-r--r--lib/libc/arch/mvme88k/sys/reboot.S49
-rw-r--r--lib/libc/arch/mvme88k/sys/sbrk.S70
-rw-r--r--lib/libc/arch/mvme88k/sys/setlogin.S48
-rw-r--r--lib/libc/arch/mvme88k/sys/sigpending.S54
-rw-r--r--lib/libc/arch/mvme88k/sys/sigprocmask.S61
-rw-r--r--lib/libc/arch/mvme88k/sys/sigreturn.S52
-rw-r--r--lib/libc/arch/mvme88k/sys/sigsuspend.S60
-rw-r--r--lib/libc/arch/mvme88k/sys/syscall.S54
-rw-r--r--lib/libc/rpc/xdr_float.c4
-rw-r--r--lib/libc/stdlib/strtod.c4
46 files changed, 2123 insertions, 4 deletions
diff --git a/lib/libc/arch/mvme88k/DEFS.h b/lib/libc/arch/mvme88k/DEFS.h
new file mode 100644
index 00000000000..c12a532745c
--- /dev/null
+++ b/lib/libc/arch/mvme88k/DEFS.h
@@ -0,0 +1,3 @@
+/* $Id: DEFS.h,v 1.1 1997/03/25 17:06:47 rahnds Exp $ */
+
+#include <machine/asm.h>
diff --git a/lib/libc/arch/mvme88k/Makefile.inc b/lib/libc/arch/mvme88k/Makefile.inc
new file mode 100644
index 00000000000..5775c172960
--- /dev/null
+++ b/lib/libc/arch/mvme88k/Makefile.inc
@@ -0,0 +1,6 @@
+# $Id: Makefile.inc,v 1.1 1997/03/25 17:06:49 rahnds Exp $
+
+KMINCLUDES= arch/m88k/DEFS.h arch/m88k/SYS.h
+#KMSRCS= bcmp.S bzero.S ffs.S strcat.c strcmp.S strcpy.S strlen.S strncmp.S \
+# strncpy.S htonl.S htons.S ntohl.S ntohs.S
+KMSRCS= htonl.S htons.S ntohl.S ntohs.S
diff --git a/lib/libc/arch/mvme88k/SYS.h b/lib/libc/arch/mvme88k/SYS.h
new file mode 100644
index 00000000000..d3307a4627a
--- /dev/null
+++ b/lib/libc/arch/mvme88k/SYS.h
@@ -0,0 +1,79 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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
+ * $Id: SYS.h,v 1.1 1997/03/25 17:06:50 rahnds Exp $
+ */
+
+#include <sys/syscall.h>
+#include <machine/asm.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) align 8; \
+ ENTRY(x); \
+ ld r10,r31,32; \
+ ld r11,r31,36; \
+ ld r12,r31,40; \
+ or r13,r0, SYS_ ## x; \
+ tb0 0, r0, 128; \
+ br cerror
+#define RSYSCALL(x) SYSCALL(x) ;\
+ jmp r1
+#define PSEUDO(x,y) ENTRY(x); ;\
+ or r13,r0, SYS_ ## y; \
+ tb0 0,r0,128; or r0,r0,r0;jmp r1
+
+#else /* !__STDC__ */
+
+#define SYSCALL(x) align 8; \
+ ENTRY(x); \
+ ld r10,r31,32; \
+ ld r11,r31,36; \
+ ld r12,r31,40; \
+ or r13,r0, SYS_/**/x; \
+ tb0 0, r0, 128; \
+ br cerror
+#define RSYSCALL(x) SYSCALL(x); \
+ jmp r1
+#define PSEUDO(x,y) ENTRY(x); \
+ or r13,r0, SYS_/**/y; \
+ tb0 0,r0,128; or r0,r0,r0; jmp r1
+#endif /* !__STDC__ */
+
+#define ASMSTR .asciz
+
+ .globl cerror
diff --git a/lib/libc/arch/mvme88k/gen/Makefile.inc b/lib/libc/arch/mvme88k/gen/Makefile.inc
new file mode 100644
index 00000000000..3c4ea22c543
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/Makefile.inc
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile.inc,v 1.3 1995/04/10 21:09:06 jtc Exp $
+
+#SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.S
+#SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
+# fpsetround.c fpsetsticky.c
+#SRCS+= fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S sigsetjmp.S
+
+SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.c ldexp.c
+SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
+ fpsetround.c fpsetsticky.c
+SRCS+= setjmp.S sigsetjmp.S
+SRCS+= modf.c
diff --git a/lib/libc/arch/mvme88k/gen/_setjmp.S b/lib/libc/arch/mvme88k/gen/_setjmp.S
new file mode 100644
index 00000000000..c31bcc67289
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/_setjmp.S
@@ -0,0 +1,32 @@
+#include "SYS.h"
+
+ENTRY(_setjmp)
+ st r1, r2,0
+ st.d r14,r2,8
+ st.d r16,r2,16
+ st.d r18,r2,24
+ st.d r20,r2,32
+ st.d r22,r2,40
+ st.d r24,r2,48
+ st.d r26,r2,56
+ st.d r28,r2,64
+ st.d r30,r2,72
+ jmp.n r1
+ or r2,r0,0
+
+ENTRY(_longjmp)
+ ld.d r14,r2,8
+ ld.d r16,r2,16
+ ld.d r18,r2,24
+ ld.d r20,r2,32
+ ld.d r22,r2,40
+ ld.d r24,r2,48
+ ld.d r26,r2,56
+ ld.d r28,r2,64
+ ld.d r30,r2,72
+ ld r1,r2,0
+ bcnd.n ne0,r3,dsrlbl
+ or r2,r3,0
+ or r2,r0,1
+ dsrlbl:
+ jmp r1
diff --git a/lib/libc/arch/mvme88k/gen/fabs.S b/lib/libc/arch/mvme88k/gen/fabs.S
new file mode 100644
index 00000000000..810ccf30ef3
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fabs.S
@@ -0,0 +1,14 @@
+#include <machine/asm.h>
+/*
+ * Will work only if the argument passed is in IEEE format!
+ */
+
+ENTRY(fabs)
+ subu r31,r31,40
+ st.d r2,r31,32
+ ld.bu r4,r31,32
+ mask r4,r4,0x7f /* set sign bit to 0 */
+ st.b r4,r31,32
+ ld.d r2,r31,32
+ jmp.n r1
+ addu r31,r31,40
diff --git a/lib/libc/arch/mvme88k/gen/flt_rounds.c b/lib/libc/arch/mvme88k/gen/flt_rounds.c
new file mode 100644
index 00000000000..ba33e2bca5b
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/flt_rounds.c
@@ -0,0 +1,23 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ */
+/*
+ * Ported to 88k (Nivas Madhur)
+ */
+
+static const int map[] = {
+ 0, /* round to nearest */
+ 1, /* round to zero */
+ 2, /* round to negative infinity */
+ 3 /* round to positive infinity */
+};
+
+int
+__flt_rounds()
+{
+ int x;
+
+ __asm__("fldcr %0,fcr63" : "=r" (x));
+ return map[(x >> 14) & 0x03];
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpgetmask.c b/lib/libc/arch/mvme88k/gen/fpgetmask.c
new file mode 100644
index 00000000000..832fe0de567
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpgetmask.c
@@ -0,0 +1,16 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Ported to 88k by Nivas Madhur.
+ */
+
+#include <ieeefp.h>
+
+fp_except
+fpgetmask()
+{
+ int x;
+
+ __asm__ volatile ("fldcr %0,fcr63" : "=r" (x));
+ return (x & 0x1f);
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpgetround.c b/lib/libc/arch/mvme88k/gen/fpgetround.c
new file mode 100644
index 00000000000..4edac881ff9
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpgetround.c
@@ -0,0 +1,16 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Ported to 88k by Nivas Madhur.
+ */
+
+#include <ieeefp.h>
+
+fp_rnd
+fpgetround()
+{
+ int x;
+
+ __asm__ volatile ("fldcr %0, fcr63" : "=r" (x));
+ return (x >> 14) & 0x03;
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpgetsticky.c b/lib/libc/arch/mvme88k/gen/fpgetsticky.c
new file mode 100644
index 00000000000..6d5bdc7bbde
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpgetsticky.c
@@ -0,0 +1,16 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Ported to 88k by Nivas Madhur
+ */
+
+#include <ieeefp.h>
+
+fp_except
+fpgetsticky()
+{
+ int x;
+
+ __asm__ volatile("fldcr %0,fcr62" : "=r" (x));
+ return x & 0x1f;
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpsetmask.c b/lib/libc/arch/mvme88k/gen/fpsetmask.c
new file mode 100644
index 00000000000..42d88a7f641
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpsetmask.c
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Porting to m88k by Nivas Madhur.
+ */
+
+#include <ieeefp.h>
+
+fp_except
+fpsetmask(mask)
+ fp_except mask;
+{
+ fp_except old;
+ fp_except new;
+
+ __asm__ volatile("fldcr %0,fcr63" : "=r" (old));
+
+ new = old;
+ new &= ~0x1f; /* clear bottom 5 bits and */
+ new |= (mask & 0x1f); /* set them to mask */
+
+ __asm__ volatile("fstcr %0,fcr63" : : "r" (new));
+
+ return (old & 0x1f);
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpsetround.c b/lib/libc/arch/mvme88k/gen/fpsetround.c
new file mode 100644
index 00000000000..417eefefa87
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpsetround.c
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Ported to 88k by Nivas Madhur
+ */
+
+#include <ieeefp.h>
+
+fp_rnd
+fpsetround(rnd_dir)
+ fp_rnd rnd_dir;
+{
+ fp_rnd old;
+ fp_rnd new;
+
+ __asm__ volatile("fldcr %0,fcr63" : "=r" (old));
+
+ new = old;
+ new &= ~(0x03 << 14); /* clear old value */
+ new |= ((rnd_dir & 0x03) << 14);/* and set new one */
+
+ __asm__ volatile("fstcr %0,fcr63" : : "r" (new));
+
+ return (old >> 14) & 0x03;
+}
diff --git a/lib/libc/arch/mvme88k/gen/fpsetsticky.c b/lib/libc/arch/mvme88k/gen/fpsetsticky.c
new file mode 100644
index 00000000000..2c3f4c8c6d8
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/fpsetsticky.c
@@ -0,0 +1,25 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ * Ported to m88k by Nivas Madhur.
+ */
+
+#include <ieeefp.h>
+
+fp_except
+fpsetsticky(sticky)
+ fp_except sticky;
+{
+ fp_except old;
+ fp_except new;
+
+ __asm__ volatile("fldcr %0,fcr62" : "=r" (old));
+
+ new = old;
+ new &= ~(0x1f);
+ new |= (sticky & 0x1f);
+
+ __asm__ volatile("fstcr %0,fcr62" : : "r" (new));
+
+ return (old & 0x1f);
+}
diff --git a/lib/libc/arch/mvme88k/gen/frexp.c b/lib/libc/arch/mvme88k/gen/frexp.c
new file mode 100644
index 00000000000..721515ec8f7
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/frexp.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * 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: Header: frexp.c,v 1.1 91/07/07 04:45:01 torek Exp
+ * $Id: frexp.c,v 1.1 1997/03/25 17:07:01 rahnds Exp $
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+
+/*
+ * Split the given value into a fraction in the range [0.5, 1.0) and
+ * an exponent, such that frac * (2^exp) == value. If value is 0,
+ * return 0.
+ */
+double
+frexp(value, eptr)
+ double value;
+ int *eptr;
+{
+ union {
+ double v;
+ struct ieee_double s;
+ } u;
+
+ if (value) {
+ /*
+ * Fractions in [0.5..1.0) have an exponent of 2^-1.
+ * Leave Inf and NaN alone, however.
+ * WHAT ABOUT DENORMS?
+ */
+ u.v = value;
+ if (u.s.dbl_exp != DBL_EXP_INFNAN) {
+ *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
+ u.s.dbl_exp = DBL_EXP_BIAS - 1;
+ }
+ return (u.v);
+ } else {
+ *eptr = 0;
+ return ((double)0);
+ }
+}
diff --git a/lib/libc/arch/mvme88k/gen/infinity.c b/lib/libc/arch/mvme88k/gen/infinity.c
new file mode 100644
index 00000000000..a60b1ceb783
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/infinity.c
@@ -0,0 +1,10 @@
+#ifndef lint
+static char rcsid[] = "$Id: infinity.c,v 1.1 1997/03/25 17:07:01 rahnds Exp $";
+#endif /* not lint */
+
+/* infinity.c */
+
+#include <math.h>
+
+/* bytes for +Infinity on 88100 */
+char __infinity[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
diff --git a/lib/libc/arch/mvme88k/gen/isinf.c b/lib/libc/arch/mvme88k/gen/isinf.c
new file mode 100644
index 00000000000..3f66ac921b1
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/isinf.c
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 1991 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. 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/*static char sccsid[] = "from: @(#)isinf.c 5.1 (Berkeley) 3/18/91";*/
+static char rcsid[] = "$Id: isinf.c,v 1.1 1997/03/25 17:07:02 rahnds Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+
+isnan(d)
+ double d;
+{
+ register struct IEEEdp {
+ u_int sign : 1;
+ u_int exp : 11;
+ u_int manh : 20;
+ u_int manl : 32;
+ } *p = (struct IEEEdp *)&d;
+
+ return(p->exp == 2047 && (p->manh || p->manl));
+}
+
+isinf(d)
+ double d;
+{
+ register struct IEEEdp {
+ u_int sign : 1;
+ u_int exp : 11;
+ u_int manh : 20;
+ u_int manl : 32;
+ } *p = (struct IEEEdp *)&d;
+
+ return(p->exp == 2047 && !p->manh && !p->manl);
+}
diff --git a/lib/libc/arch/mvme88k/gen/isnan.c b/lib/libc/arch/mvme88k/gen/isnan.c
new file mode 100644
index 00000000000..1605fb2329a
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/isnan.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * 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: Header: isnan.c,v 1.1 91/07/08 19:03:34 torek Exp
+ * $Id: isnan.c,v 1.1 1997/03/25 17:07:03 rahnds Exp $
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)isnan.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+
+isnan(d)
+ double d;
+{
+ register struct ieee_double *p = (struct ieee_double *)&d;
+
+ return (p->dbl_exp == DBL_EXP_INFNAN &&
+ (p->dbl_frach != 0 || p->dbl_fracl != 0));
+}
diff --git a/lib/libc/arch/mvme88k/gen/ldexp.c b/lib/libc/arch/mvme88k/gen/ldexp.c
new file mode 100644
index 00000000000..69032238bb7
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/ldexp.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * 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: Header: ldexp.c,v 1.1 91/07/07 04:28:19 torek Exp
+ * $Id: ldexp.c,v 1.1 1997/03/25 17:07:04 rahnds Exp $
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <errno.h>
+
+/*
+ * double ldexp(double val, int exp)
+ * returns: val * (2**exp)
+ */
+double
+ldexp(val, exp)
+ double val;
+ int exp;
+{
+ register int oldexp, newexp, mulexp;
+ union doub {
+ double v;
+ struct ieee_double s;
+ } u, mul;
+
+ /*
+ * If input is zero, or no change, just return input.
+ * Likewise, if input is Inf or NaN, just return it.
+ */
+ u.v = val;
+ oldexp = u.s.dbl_exp;
+ if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
+ return (val);
+
+ /*
+ * Compute new exponent and check for over/under flow.
+ * Underflow, unfortunately, could mean switching to denormal.
+ * If result out of range, set ERANGE and return 0 if too small
+ * or Inf if too big, with the same sign as the input value.
+ */
+ newexp = oldexp + exp;
+ if (newexp >= DBL_EXP_INFNAN) {
+ /* u.s.dbl_sign = val < 0; -- already set */
+ u.s.dbl_exp = DBL_EXP_INFNAN;
+ u.s.dbl_frach = u.s.dbl_fracl = 0;
+ errno = ERANGE;
+ return (u.v); /* Inf */
+ }
+ if (newexp <= 0) {
+ /*
+ * The output number is either a denormal or underflows
+ * (see comments in machine/ieee.h).
+ */
+ if (newexp <= -DBL_FRACBITS) {
+ /* u.s.dbl_sign = val < 0; -- already set */
+ u.s.dbl_exp = 0;
+ u.s.dbl_frach = u.s.dbl_fracl = 0;
+ errno = ERANGE;
+ return (u.v); /* zero */
+ }
+ /*
+ * We are going to produce a denorm. Our `exp' argument
+ * might be as small as -2097, and we cannot compute
+ * 2^-2097, so we may have to do this as many as three
+ * steps (not just two, as for positive `exp's below).
+ */
+ mul.v = 0;
+ while (exp <= -DBL_EXP_BIAS) {
+ mul.s.dbl_exp = 1;
+ val *= mul.v;
+ exp += DBL_EXP_BIAS - 1;
+ }
+ mul.s.dbl_exp = exp + DBL_EXP_BIAS;
+ val *= mul.v;
+ return (val);
+ }
+
+ /*
+ * Newexp is positive.
+ *
+ * If oldexp is zero, we are starting with a denorm, and simply
+ * adjusting the exponent will produce bogus answers. We need
+ * to fix that first.
+ */
+ if (oldexp == 0) {
+ /*
+ * Multiply by 2^mulexp to make the number normalizable.
+ * We cannot multiply by more than 2^1023, but `exp'
+ * argument might be as large as 2046. A single
+ * adjustment, however, will normalize the number even
+ * for huge `exp's, and then we can use exponent
+ * arithmetic just as for normal `double's.
+ */
+ mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
+ mul.v = 0;
+ mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
+ val *= mul.v;
+ if (mulexp == exp)
+ return (val);
+ u.v = val;
+ newexp -= mulexp;
+ }
+
+ /*
+ * Both oldexp and newexp are positive; just replace the
+ * old exponent with the new one.
+ */
+ u.s.dbl_exp = newexp;
+ return (u.v);
+}
diff --git a/lib/libc/arch/mvme88k/gen/modf.c b/lib/libc/arch/mvme88k/gen/modf.c
new file mode 100644
index 00000000000..ea2be134ba9
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/modf.c
@@ -0,0 +1,309 @@
+/* @(#)s_modf.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: s_modf.c,v 1.8 1995/05/10 20:47:55 jtc Exp $";
+#endif
+
+/*
+ * modf(double x, double *iptr)
+ * return fraction part of x, and return x's integral part in *iptr.
+ * Method:
+ * Bit twiddling.
+ *
+ * Exception:
+ * No exception.
+ */
+
+#include "math.h"
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $Id: modf.c,v 1.1 1997/03/25 17:07:05 rahnds Exp $
+ */
+
+#ifndef _MATH_PRIVATE_H_
+#define _MATH_PRIVATE_H_
+
+#include <sys/types.h>
+#include <machine/endian.h>
+
+/* The original fdlibm code used statements like:
+ n0 = ((*(int*)&one)>>29)^1; * index of high word *
+ ix0 = *(n0+(int*)&x); * high word of x *
+ ix1 = *((1-n0)+(int*)&x); * low word of x *
+ to dig two 32 bit words out of the 64 bit IEEE floating point
+ value. That is non-ANSI, and, moreover, the gcc instruction
+ scheduler gets it wrong. We instead use the following macros.
+ Unlike the original code, we determine the endianness at compile
+ time, not at run time; I don't see much benefit to selecting
+ endianness at run time. */
+
+/* A union which permits us to convert between a double and two 32 bit
+ ints. */
+
+/*
+ * The arm32 port is little endian except for the FP word order which is
+ * big endian.
+ */
+
+#if (BYTE_ORDER == BIG_ENDIAN) || defined(arm32)
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t msw;
+ u_int32_t lsw;
+ } parts;
+} ieee_double_shape_type;
+
+#endif
+
+#if (BYTE_ORDER == LITTLE_ENDIAN) && !defined(arm32)
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t lsw;
+ u_int32_t msw;
+ } parts;
+} ieee_double_shape_type;
+
+#endif
+
+/* Get two 32 bit ints from a double. */
+
+#define EXTRACT_WORDS(ix0,ix1,d) \
+do { \
+ ieee_double_shape_type ew_u; \
+ ew_u.value = (d); \
+ (ix0) = ew_u.parts.msw; \
+ (ix1) = ew_u.parts.lsw; \
+} while (0)
+
+/* Get the more significant 32 bit int from a double. */
+
+#define GET_HIGH_WORD(i,d) \
+do { \
+ ieee_double_shape_type gh_u; \
+ gh_u.value = (d); \
+ (i) = gh_u.parts.msw; \
+} while (0)
+
+/* Get the less significant 32 bit int from a double. */
+
+#define GET_LOW_WORD(i,d) \
+do { \
+ ieee_double_shape_type gl_u; \
+ gl_u.value = (d); \
+ (i) = gl_u.parts.lsw; \
+} while (0)
+
+/* Set a double from two 32 bit ints. */
+
+#define INSERT_WORDS(d,ix0,ix1) \
+do { \
+ ieee_double_shape_type iw_u; \
+ iw_u.parts.msw = (ix0); \
+ iw_u.parts.lsw = (ix1); \
+ (d) = iw_u.value; \
+} while (0)
+
+/* Set the more significant 32 bits of a double from an int. */
+
+#define SET_HIGH_WORD(d,v) \
+do { \
+ ieee_double_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts.msw = (v); \
+ (d) = sh_u.value; \
+} while (0)
+
+/* Set the less significant 32 bits of a double from an int. */
+
+#define SET_LOW_WORD(d,v) \
+do { \
+ ieee_double_shape_type sl_u; \
+ sl_u.value = (d); \
+ sl_u.parts.lsw = (v); \
+ (d) = sl_u.value; \
+} while (0)
+
+/* A union which permits us to convert between a float and a 32 bit
+ int. */
+
+typedef union
+{
+ float value;
+ u_int32_t word;
+} ieee_float_shape_type;
+
+/* Get a 32 bit int from a float. */
+
+#define GET_FLOAT_WORD(i,d) \
+do { \
+ ieee_float_shape_type gf_u; \
+ gf_u.value = (d); \
+ (i) = gf_u.word; \
+} while (0)
+
+/* Set a float from a 32 bit int. */
+
+#define SET_FLOAT_WORD(d,i) \
+do { \
+ ieee_float_shape_type sf_u; \
+ sf_u.word = (i); \
+ (d) = sf_u.value; \
+} while (0)
+
+/* ieee style elementary functions */
+extern double __ieee754_sqrt __P((double));
+extern double __ieee754_acos __P((double));
+extern double __ieee754_acosh __P((double));
+extern double __ieee754_log __P((double));
+extern double __ieee754_atanh __P((double));
+extern double __ieee754_asin __P((double));
+extern double __ieee754_atan2 __P((double,double));
+extern double __ieee754_exp __P((double));
+extern double __ieee754_cosh __P((double));
+extern double __ieee754_fmod __P((double,double));
+extern double __ieee754_pow __P((double,double));
+extern double __ieee754_lgamma_r __P((double,int *));
+extern double __ieee754_gamma_r __P((double,int *));
+extern double __ieee754_lgamma __P((double));
+extern double __ieee754_gamma __P((double));
+extern double __ieee754_log10 __P((double));
+extern double __ieee754_sinh __P((double));
+extern double __ieee754_hypot __P((double,double));
+extern double __ieee754_j0 __P((double));
+extern double __ieee754_j1 __P((double));
+extern double __ieee754_y0 __P((double));
+extern double __ieee754_y1 __P((double));
+extern double __ieee754_jn __P((int,double));
+extern double __ieee754_yn __P((int,double));
+extern double __ieee754_remainder __P((double,double));
+extern int __ieee754_rem_pio2 __P((double,double*));
+extern double __ieee754_scalb __P((double,double));
+
+/* fdlibm kernel function */
+extern double __kernel_standard __P((double,double,int));
+extern double __kernel_sin __P((double,double,int));
+extern double __kernel_cos __P((double,double));
+extern double __kernel_tan __P((double,double,int));
+extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
+
+
+/* ieee style elementary float functions */
+extern float __ieee754_sqrtf __P((float));
+extern float __ieee754_acosf __P((float));
+extern float __ieee754_acoshf __P((float));
+extern float __ieee754_logf __P((float));
+extern float __ieee754_atanhf __P((float));
+extern float __ieee754_asinf __P((float));
+extern float __ieee754_atan2f __P((float,float));
+extern float __ieee754_expf __P((float));
+extern float __ieee754_coshf __P((float));
+extern float __ieee754_fmodf __P((float,float));
+extern float __ieee754_powf __P((float,float));
+extern float __ieee754_lgammaf_r __P((float,int *));
+extern float __ieee754_gammaf_r __P((float,int *));
+extern float __ieee754_lgammaf __P((float));
+extern float __ieee754_gammaf __P((float));
+extern float __ieee754_log10f __P((float));
+extern float __ieee754_sinhf __P((float));
+extern float __ieee754_hypotf __P((float,float));
+extern float __ieee754_j0f __P((float));
+extern float __ieee754_j1f __P((float));
+extern float __ieee754_y0f __P((float));
+extern float __ieee754_y1f __P((float));
+extern float __ieee754_jnf __P((int,float));
+extern float __ieee754_ynf __P((int,float));
+extern float __ieee754_remainderf __P((float,float));
+extern int __ieee754_rem_pio2f __P((float,float*));
+extern float __ieee754_scalbf __P((float,float));
+
+/* float versions of fdlibm kernel functions */
+extern float __kernel_sinf __P((float,float,int));
+extern float __kernel_cosf __P((float,float));
+extern float __kernel_tanf __P((float,float,int));
+extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const int*));
+
+#endif /* _MATH_PRIVATE_H_ */
+#ifdef __STDC__
+static const double one = 1.0;
+#else
+static double one = 1.0;
+#endif
+
+#ifdef __STDC__
+ double modf(double x, double *iptr)
+#else
+ double modf(x, iptr)
+ double x,*iptr;
+#endif
+{
+ int32_t i0,i1,j0;
+ u_int32_t i;
+ EXTRACT_WORDS(i0,i1,x);
+ j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
+ if(j0<20) { /* integer part in high x */
+ if(j0<0) { /* |x|<1 */
+ INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
+ return x;
+ } else {
+ i = (0x000fffff)>>j0;
+ if(((i0&i)|i1)==0) { /* x is integral */
+ u_int32_t high;
+ *iptr = x;
+ GET_HIGH_WORD(high,x);
+ INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
+ return x;
+ } else {
+ INSERT_WORDS(*iptr,i0&(~i),0);
+ return x - *iptr;
+ }
+ }
+ } else if (j0>51) { /* no fraction part */
+ u_int32_t high;
+ *iptr = x*one;
+ GET_HIGH_WORD(high,x);
+ INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
+ return x;
+ } else { /* fraction part in low x */
+ i = ((u_int32_t)(0xffffffff))>>(j0-20);
+ if((i1&i)==0) { /* x is integral */
+ u_int32_t high;
+ *iptr = x;
+ GET_HIGH_WORD(high,x);
+ INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
+ return x;
+ } else {
+ INSERT_WORDS(*iptr,i0,i1&(~i));
+ return x - *iptr;
+ }
+ }
+}
diff --git a/lib/libc/arch/mvme88k/gen/setjmp.S b/lib/libc/arch/mvme88k/gen/setjmp.S
new file mode 100644
index 00000000000..6b7d6c0162f
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/setjmp.S
@@ -0,0 +1,39 @@
+#include "SYS.h"
+
+ENTRY(setjmp)
+ st r1, r2,0
+ st.d r14,r2,8
+ st.d r16,r2,16
+ st.d r18,r2,24
+ st.d r20,r2,32
+ st.d r22,r2,40
+ st.d r24,r2,48
+ st.d r26,r2,56
+ st.d r28,r2,64
+ st.d r30,r2,72
+ or r15,r1,0 /* can use r15 */
+ or r14,r2,0 /* can use r14 as it is already saved */
+ bsr.n _sigblock
+ or r2,r0,0
+ st r2,r14,4
+ jmp.n r15
+ or r2,r0,0
+
+ENTRY(longjmp)
+ subu r31,r31,32 /* get some temporary stack */
+ ld.d r14,r2,8
+ ld.d r16,r2,16
+ ld.d r18,r2,24
+ ld.d r20,r2,32
+ ld.d r22,r2,40
+ ld.d r24,r2,48
+ ld.d r26,r2,56
+ ld.d r28,r2,64
+ st.d r2,r31,24 /* save r2 and r3 on stack */
+ bsr.n _sigsetmask
+ ld r2,r2,4
+ ld.d r2,r31,24 /* restore r2 and r3 from stack */
+ ld.d r30,r2,72 /* restore r30 and r31 */
+ ld r1,r2,0 /* restore r1 */
+ jmp.n r1 /* and jump to it */
+ or r2,r0,r3 /* but first return r3 value */
diff --git a/lib/libc/arch/mvme88k/gen/sigsetjmp.S b/lib/libc/arch/mvme88k/gen/sigsetjmp.S
new file mode 100644
index 00000000000..2f6f7bffa83
--- /dev/null
+++ b/lib/libc/arch/mvme88k/gen/sigsetjmp.S
@@ -0,0 +1,43 @@
+#include "SYS.h"
+
+/*
+ * Need to write sigsetjmp version. But for now,
+ * I am copying setjmp XXX nivas
+ */
+ENTRY(sigsetjmp)
+ st r1, r2,0
+ st.d r14,r2,8
+ st.d r16,r2,16
+ st.d r18,r2,24
+ st.d r20,r2,32
+ st.d r22,r2,40
+ st.d r24,r2,48
+ st.d r26,r2,56
+ st.d r28,r2,64
+ st.d r30,r2,72
+ or r15,r1,0 /* can use r15 */
+ or r14,r2,0 /* can use r14 as it is already saved */
+ bsr.n _sigblock
+ or r2,r0,0
+ st r2,r14,4
+ jmp.n r15
+ or r2,r0,0
+
+ENTRY(siglongjmp)
+ subu r31,r31,32 /* get some temporary stack */
+ ld.d r14,r2,8
+ ld.d r16,r2,16
+ ld.d r18,r2,24
+ ld.d r20,r2,32
+ ld.d r22,r2,40
+ ld.d r24,r2,48
+ ld.d r26,r2,56
+ ld.d r28,r2,64
+ st.d r2,r31,24 /* save r2 and r3 on stack */
+ bsr.n _sigsetmask
+ ld r2,r2,4
+ ld.d r2,r31,24 /* restore r2 and r3 from stack */
+ ld.d r30,r2,72 /* restore r30 and r31 */
+ ld r1,r2,0 /* restore r1 */
+ jmp.n r1 /* and jump to it */
+ or r2,r0,r3 /* but first return r3 value */
diff --git a/lib/libc/arch/mvme88k/net/Makefile.inc b/lib/libc/arch/mvme88k/net/Makefile.inc
new file mode 100644
index 00000000000..dc2ddf344cc
--- /dev/null
+++ b/lib/libc/arch/mvme88k/net/Makefile.inc
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:58:55 cgd Exp $
+
+SRCS+= htonl.S htons.S ntohl.S ntohs.S
diff --git a/lib/libc/arch/mvme88k/net/htonl.S b/lib/libc/arch/mvme88k/net/htonl.S
new file mode 100644
index 00000000000..41ca46ae92d
--- /dev/null
+++ b/lib/libc/arch/mvme88k/net/htonl.S
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .text
+ /*.asciz "from: @(#)htonl.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: htonl.S,v 1.1 1997/03/25 17:07:09 rahnds Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* netorder = htonl(hostorder) */
+
+#include "DEFS.h"
+
+ENTRY(htonl)
+ jmp r1
diff --git a/lib/libc/arch/mvme88k/net/htons.S b/lib/libc/arch/mvme88k/net/htons.S
new file mode 100644
index 00000000000..e97e36c492e
--- /dev/null
+++ b/lib/libc/arch/mvme88k/net/htons.S
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .text
+ /*.asciz "from: @(#)htons.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: htons.S,v 1.1 1997/03/25 17:07:10 rahnds Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = htons(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(htons)
+ jmp.n r1
+ clr r2,r2,16<16> /* clear the top 16 bits */
diff --git a/lib/libc/arch/mvme88k/net/ntohl.S b/lib/libc/arch/mvme88k/net/ntohl.S
new file mode 100644
index 00000000000..c611088c36d
--- /dev/null
+++ b/lib/libc/arch/mvme88k/net/ntohl.S
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .text
+ /*.asciz "from: @(#)ntohl.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: ntohl.S,v 1.1 1997/03/25 17:07:10 rahnds Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = ntohl(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(ntohl)
+ jmp r1
diff --git a/lib/libc/arch/mvme88k/net/ntohs.S b/lib/libc/arch/mvme88k/net/ntohs.S
new file mode 100644
index 00000000000..d0d2636952b
--- /dev/null
+++ b/lib/libc/arch/mvme88k/net/ntohs.S
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .text
+ /*.asciz "from: @(#)ntohs.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: ntohs.S,v 1.1 1997/03/25 17:07:11 rahnds Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = ntohs(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(ntohs)
+ jmp.n r1
+ clr r2,r2,16<16> /* clear the top 16 bits */
diff --git a/lib/libc/arch/mvme88k/string/Makefile.inc b/lib/libc/arch/mvme88k/string/Makefile.inc
new file mode 100644
index 00000000000..86cf0d0710f
--- /dev/null
+++ b/lib/libc/arch/mvme88k/string/Makefile.inc
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile.inc,v 1.1 1995/03/20 14:45:45 mycroft Exp $
+
+#SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.S memset.S \
+# rindex.S strcat.c strcmp.S strcpy.S strcspn.c strlen.S \
+# strncat.c strncmp.S strncpy.S strpbrk.c strsep.c \
+# strspn.c strstr.c swab.S
+#SRCS+= memcpy.S memmove.S strchr.S strrchr.S
+SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \
+ rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \
+ strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
+ strspn.c strstr.c swab.c
+#SRCS+= index.c rindex.c
diff --git a/lib/libc/arch/mvme88k/string/strchr.c b/lib/libc/arch/mvme88k/string/strchr.c
new file mode 100644
index 00000000000..31daf6cfcf5
--- /dev/null
+++ b/lib/libc/arch/mvme88k/string/strchr.c
@@ -0,0 +1,13 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+/*static char *sccsid = "from: @(#)strlen.c 5.5 (Berkeley) 1/26/91";*/
+static char *rcsid = "$Id: strchr.c,v 1.1 1997/03/25 17:07:13 rahnds Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <string.h>
+
+char *
+strchr(str, c)
+ const char *str;
+{
+ index(str, c);
+}
diff --git a/lib/libc/arch/mvme88k/string/strrchr.c b/lib/libc/arch/mvme88k/string/strrchr.c
new file mode 100644
index 00000000000..a9c8ddb7041
--- /dev/null
+++ b/lib/libc/arch/mvme88k/string/strrchr.c
@@ -0,0 +1,13 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+/*static char *sccsid = "from: @(#)strlen.c 5.5 (Berkeley) 1/26/91";*/
+static char *rcsid = "$Id: strrchr.c,v 1.1 1997/03/25 17:07:14 rahnds Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <string.h>
+
+char *
+strrchr(str, c)
+ const char *str;
+{
+ rindex(str, c);
+}
diff --git a/lib/libc/arch/mvme88k/sys/Ovfork.S b/lib/libc/arch/mvme88k/sys/Ovfork.S
new file mode 100644
index 00000000000..077c111689f
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/Ovfork.S
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)fork.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: Ovfork.S,v 1.1 1997/03/25 17:07:16 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/* r2 = pid. r3 = 0 in parent, 1 in child */
+
+SYSCALL(vfork)
+ bcnd eq0,r3,parent
+ or r2,r0,0
+ or r3,r0,0
+parent:
+ jmp r1 /* pid = vfork() */
diff --git a/lib/libc/arch/mvme88k/sys/brk.S b/lib/libc/arch/mvme88k/sys/brk.S
new file mode 100644
index 00000000000..b56693a755d
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/brk.S
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)brk.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: brk.S,v 1.1 1997/03/25 17:07:16 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl minbrk
+ .globl curbrk
+
+ .data
+minbrk: .long 0
+ .text
+
+ENTRY(brk)
+ or.u r5,r0,hi16(minbrk)
+ ld r5,r5,lo16(minbrk)
+ cmp r3,r5,r2
+ bb1 le,r3,1f /* r2 should be > minbrk; can't go below end */
+ or r2,r5,0 /* otherwise, set r2 to minbrk */
+1:
+ or r4,r2,0
+ or r13,r0,SYS_break
+ tb0 0,r0,128
+ br cerror
+ or.u r5,r0,hi16(curbrk)
+ st r4,r5,lo16(curbrk)
+ or r2,r0,0 /* clear r2/r3 to indicate success */
+ jmp.n r1
+ or r3,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/cerror.S b/lib/libc/arch/mvme88k/sys/cerror.S
new file mode 100644
index 00000000000..a268f693d88
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/cerror.S
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)cerror.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: cerror.S,v 1.1 1997/03/25 17:07:17 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .align 8
+ .globl _errno
+cerror:
+ or.u r4,r0,hi16(_errno)
+ st r2,r4,lo16(_errno)
+ sub r2,r0,0x1
+ jmp.n r1
+ sub r3,r0,0x1
diff --git a/lib/libc/arch/mvme88k/sys/exect.S b/lib/libc/arch/mvme88k/sys/exect.S
new file mode 100644
index 00000000000..a334a719d6c
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/exect.S
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)exect.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: exect.S,v 1.1 1997/03/25 17:07:18 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(exect)
+ or r13,r0,SYS_execve
+ tb0 0,r0,128 /* exect(file, argv, env) */
+ br cerror
diff --git a/lib/libc/arch/mvme88k/sys/fork.S b/lib/libc/arch/mvme88k/sys/fork.S
new file mode 100644
index 00000000000..34fa85ff344
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/fork.S
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)fork.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: fork.S,v 1.1 1997/03/25 17:07:19 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/* r2 = pid. r3 = 0 in parent, 1 in child */
+
+SYSCALL(fork)
+ bcnd eq0,r3,parent
+ or r2,r0,0
+ or r3,r0,0
+parent:
+ jmp r1 /* pid = fork() */
diff --git a/lib/libc/arch/mvme88k/sys/pipe.S b/lib/libc/arch/mvme88k/sys/pipe.S
new file mode 100644
index 00000000000..9c379ec1e03
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/pipe.S
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)pipe.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: pipe.S,v 1.1 1997/03/25 17:07:20 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(pipe)
+ or r4,r2,0
+ or r13,r0,SYS_pipe
+ tb0 0,r0,128
+ br cerror
+ st r2,r4,0
+ st r3,r4,4
+ jmp.n r1
+ or r2,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/ptrace.S b/lib/libc/arch/mvme88k/sys/ptrace.S
new file mode 100644
index 00000000000..ab75908eb24
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/ptrace.S
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: ptrace.S,v 1.1 1997/03/25 17:07:22 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _errno
+
+ENTRY(ptrace)
+ or.u r9,r0,hi16(_errno)
+ st r0,r9,lo16(_errno)
+ or r13,r0,SYS_ptrace
+ tb0 0,r0,128
+ br cerror
+ jmp r1
diff --git a/lib/libc/arch/mvme88k/sys/reboot.S b/lib/libc/arch/mvme88k/sys/reboot.S
new file mode 100644
index 00000000000..c8e3985b998
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/reboot.S
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)reboot.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: reboot.S,v 1.1 1997/03/25 17:07:22 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(reboot)
+ or r9,r0,0x63
+ tb0 0,r0,496 /* call bug trap */
diff --git a/lib/libc/arch/mvme88k/sys/sbrk.S b/lib/libc/arch/mvme88k/sys/sbrk.S
new file mode 100644
index 00000000000..5a0ff4f8f1c
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/sbrk.S
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)sbrk.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: sbrk.S,v 1.1 1997/03/25 17:07:23 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl curbrk
+
+ .data
+curbrk: .long _end
+ .text
+
+ENTRY(sbrk)
+ or.u r5,r0,hi16(curbrk)
+ ld r5,r5,lo16(curbrk)
+ add r2,r2,r5
+ or r4,r2,0
+ or r13,r0,SYS_break
+ tb0 0,r0,128
+ br cerror
+ /* Save old curbrk */
+ or.u r5,r0,hi16(curbrk)
+ ld r3,r5,lo16(curbrk)
+ /* Update curbrk */
+ st r4,r5,lo16(curbrk)
+ /* and return old curbrk */
+ or r2,r3,0
+ jmp.n r1
+ or r3,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/setlogin.S b/lib/libc/arch/mvme88k/sys/setlogin.S
new file mode 100644
index 00000000000..fe8ef156a33
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/setlogin.S
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1991 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. 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)setlogin.s 5.1 (Berkeley) 5/6/91"*/
+ .asciz "$Id: setlogin.S,v 1.1 1997/03/25 17:07:24 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl ___logname_valid /* in getlogin() */
+
+SYSCALL(setlogin)
+ or.u r2,r0,hi16(___logname_valid)
+ st r0,r2,lo16(___logname_valid)
+ jmp r1 /* setlogin(name) */
diff --git a/lib/libc/arch/mvme88k/sys/sigpending.S b/lib/libc/arch/mvme88k/sys/sigpending.S
new file mode 100644
index 00000000000..07edb56fc2f
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/sigpending.S
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)sigpending.s 5.2 (Berkeley) 8/6/90"*/
+ .asciz "$Id: sigpending.S,v 1.1 1997/03/25 17:07:24 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(sigpending)
+ or r4,r2,0 /* save r2 */
+ or r13,r0,SYS_sigpending
+ tb0 0,r0,128
+ br cerror
+ st r2,r4,0
+ jmp.n r1
+ or r2,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/sigprocmask.S b/lib/libc/arch/mvme88k/sys/sigprocmask.S
new file mode 100644
index 00000000000..22ce43ad567
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/sigprocmask.S
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)sigprocmask.s 5.2 (Berkeley) 6/6/90"*/
+ .asciz "$Id: sigprocmask.S,v 1.1 1997/03/25 17:07:25 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(sigprocmask)
+ bcnd ne0,r3,L1 /* if new sigset pointer is null */
+ or r2,r0,1 /* how = SIG_BLOCK and do it */
+ br L2
+L1:
+ ld r3,r3,0 /* else load set from *set and do it */
+L2:
+ or r13,r0,SYS_sigprocmask
+ tb0 0,r0,128
+ br cerror
+ bcnd eq0,r4,out /* if old mask not requested, done */
+ st r2,r4,0 /* otherwise, set it */
+out:
+ jmp.n r1
+ or r2,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/sigreturn.S b/lib/libc/arch/mvme88k/sys/sigreturn.S
new file mode 100644
index 00000000000..07e8b69c65f
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/sigreturn.S
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)sigreturn.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: sigreturn.S,v 1.1 1997/03/25 17:07:26 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/*
+ * We must preserve the state of the registers as the user has set them up.
+ * Not sure what should be done XXX nivas
+ */
+
+RSYSCALL(sigreturn)
diff --git a/lib/libc/arch/mvme88k/sys/sigsuspend.S b/lib/libc/arch/mvme88k/sys/sigsuspend.S
new file mode 100644
index 00000000000..7982a970e32
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/sigsuspend.S
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)sigsuspend.s 5.2 (Berkeley) 6/6/90"*/
+ .asciz "$Id: sigsuspend.S,v 1.1 1997/03/25 17:07:26 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/*
+ * Sigsuspend actually expects a pointer to the the mask. To save
+ * a copyin in the kernel, we do the dereference here and pass it.
+ * This will be fail if we ever have more than 32 signals ie. sizeof
+ * sigset_t != sizeof int.
+ */
+
+ENTRY(sigsuspend)
+ ld r2,r2,0 /* dereference the pointer mask */
+ or r13,r0,SYS_sigsuspend
+ tb0 0,r0,128
+ br cerror
+ jmp.n r1
+ or r2,r0,0
diff --git a/lib/libc/arch/mvme88k/sys/syscall.S b/lib/libc/arch/mvme88k/sys/syscall.S
new file mode 100644
index 00000000000..eada19a7f78
--- /dev/null
+++ b/lib/libc/arch/mvme88k/sys/syscall.S
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .data
+ /*.asciz "from: @(#)syscall.s 5.1 (Berkeley) 5/12/90"*/
+ .asciz "$Id: syscall.S,v 1.1 1997/03/25 17:07:28 rahnds Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(syscall)
+ ld r10,r31,32
+ ld r11,r31,36
+ ld r12,r31,40
+ or r9,r0,0
+ tb0 0,r0,128
+ br cerror
+ jmp r1
diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c
index 6449645bc1e..5141130da4f 100644
--- a/lib/libc/rpc/xdr_float.c
+++ b/lib/libc/rpc/xdr_float.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_float.c,v 1.6 1997/02/21 19:35:33 gvf Exp $";
+static char *rcsid = "$OpenBSD: xdr_float.c,v 1.7 1997/03/25 17:07:29 rahnds Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -54,7 +54,7 @@ static char *rcsid = "$OpenBSD: xdr_float.c,v 1.6 1997/02/21 19:35:33 gvf Exp $"
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
- defined(__arm32__) || defined(__powerpc__)
+ defined(__arm32__) || defined(__powerpc__) || defined(__m88k__)
#include <machine/endian.h>
#define IEEEFP
#endif
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index 5ee50867a9d..a4ba993095d 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -90,12 +90,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strtod.c,v 1.8 1997/01/09 03:19:01 rahnds Exp $";
+static char *rcsid = "$OpenBSD: strtod.c,v 1.9 1997/03/25 17:07:30 rahnds Exp $";
#endif /* LIBC_SCCS and not lint */
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
- defined(__powerpc__)
+ defined(__powerpc__) || defined(__m88k__)
#include <sys/types.h>
#if BYTE_ORDER == BIG_ENDIAN
#define IEEE_BIG_ENDIAN