summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>1998-12-15 07:10:35 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>1998-12-15 07:10:35 +0000
commit8c52ec1cbfe87f032a8ae928067ea5380f51a38b (patch)
tree344d1cfd60d5021be3407aa338e52200efd1141d
parentf719697796a8df522e266b6aa5ace456ff20f340 (diff)
correted sigsetjmp, setjump. Fixed MACHINE_ARCH vs. MACHINE stuff.
-rw-r--r--lib/libc/arch/m88k/DEFS.h3
-rw-r--r--lib/libc/arch/m88k/Makefile.inc6
-rw-r--r--lib/libc/arch/m88k/SYS.h79
-rw-r--r--lib/libc/arch/m88k/gen/Makefile.inc12
-rw-r--r--lib/libc/arch/m88k/gen/_setjmp.S50
-rw-r--r--lib/libc/arch/m88k/gen/fabs.S14
-rw-r--r--lib/libc/arch/m88k/gen/flt_rounds.c27
-rw-r--r--lib/libc/arch/m88k/gen/fpgetmask.c16
-rw-r--r--lib/libc/arch/m88k/gen/fpgetround.c16
-rw-r--r--lib/libc/arch/m88k/gen/fpgetsticky.c16
-rw-r--r--lib/libc/arch/m88k/gen/fpsetmask.c25
-rw-r--r--lib/libc/arch/m88k/gen/fpsetround.c25
-rw-r--r--lib/libc/arch/m88k/gen/fpsetsticky.c25
-rw-r--r--lib/libc/arch/m88k/gen/frexp.c79
-rw-r--r--lib/libc/arch/m88k/gen/infinity.c10
-rw-r--r--lib/libc/arch/m88k/gen/isinf.c65
-rw-r--r--lib/libc/arch/m88k/gen/isnan.c55
-rw-r--r--lib/libc/arch/m88k/gen/ldexp.c148
-rw-r--r--lib/libc/arch/m88k/gen/modf.c309
-rw-r--r--lib/libc/arch/m88k/gen/setjmp.S61
-rw-r--r--lib/libc/arch/m88k/gen/sigsetjmp.S64
-rw-r--r--lib/libc/arch/m88k/net/Makefile.inc3
-rw-r--r--lib/libc/arch/m88k/net/htonl.S49
-rw-r--r--lib/libc/arch/m88k/net/htons.S50
-rw-r--r--lib/libc/arch/m88k/net/ntohl.S49
-rw-r--r--lib/libc/arch/m88k/net/ntohs.S50
-rw-r--r--lib/libc/arch/m88k/string/Makefile.inc12
-rw-r--r--lib/libc/arch/m88k/string/strchr.co13
-rw-r--r--lib/libc/arch/m88k/string/strrchr.co13
-rw-r--r--lib/libc/arch/m88k/sys/Ovfork.S54
-rw-r--r--lib/libc/arch/m88k/sys/brk.S71
-rw-r--r--lib/libc/arch/m88k/sys/cerror.S54
-rw-r--r--lib/libc/arch/m88k/sys/exect.S50
-rw-r--r--lib/libc/arch/m88k/sys/fork.S54
-rw-r--r--lib/libc/arch/m88k/sys/pipe.S55
-rw-r--r--lib/libc/arch/m88k/sys/ptrace.S55
-rw-r--r--lib/libc/arch/m88k/sys/reboot.S49
-rw-r--r--lib/libc/arch/m88k/sys/sbrk.S74
-rw-r--r--lib/libc/arch/m88k/sys/setlogin.S48
-rw-r--r--lib/libc/arch/m88k/sys/sigpending.S54
-rw-r--r--lib/libc/arch/m88k/sys/sigprocmask.S61
-rw-r--r--lib/libc/arch/m88k/sys/sigreturn.S52
-rw-r--r--lib/libc/arch/m88k/sys/sigsuspend.S60
-rw-r--r--lib/libc/arch/m88k/sys/syscall.S54
44 files changed, 2189 insertions, 0 deletions
diff --git a/lib/libc/arch/m88k/DEFS.h b/lib/libc/arch/m88k/DEFS.h
new file mode 100644
index 00000000000..2a458300a5e
--- /dev/null
+++ b/lib/libc/arch/m88k/DEFS.h
@@ -0,0 +1,3 @@
+/* $Id: DEFS.h,v 1.1 1998/12/15 07:10:28 smurph Exp $ */
+
+#include <machine/asm.h>
diff --git a/lib/libc/arch/m88k/Makefile.inc b/lib/libc/arch/m88k/Makefile.inc
new file mode 100644
index 00000000000..43f3c9253fe
--- /dev/null
+++ b/lib/libc/arch/m88k/Makefile.inc
@@ -0,0 +1,6 @@
+# $Id: Makefile.inc,v 1.1 1998/12/15 07:10:29 smurph 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/m88k/SYS.h b/lib/libc/arch/m88k/SYS.h
new file mode 100644
index 00000000000..042a1ce1211
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:29 smurph 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/m88k/gen/Makefile.inc b/lib/libc/arch/m88k/gen/Makefile.inc
new file mode 100644
index 00000000000..3c4ea22c543
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/_setjmp.S b/lib/libc/arch/m88k/gen/_setjmp.S
new file mode 100644
index 00000000000..d7228f04ede
--- /dev/null
+++ b/lib/libc/arch/m88k/gen/_setjmp.S
@@ -0,0 +1,50 @@
+#include "SYS.h"
+
+ENTRY(_setjmp)
+ st r1, r2,0
+ st r14,r2,8
+ st r15,r2,12
+ st r16,r2,16
+ st r17,r2,20
+ st r18,r2,24
+ st r19,r2,28
+ st r20,r2,32
+ st r21,r2,36
+ st r22,r2,40
+ st r23,r2,44
+ st r24,r2,48
+ st r25,r2,52
+ st r26,r2,56
+ st r27,r2,60
+ st r28,r2,64
+ st r29,r2,68
+ st r30,r2,72
+ st r31,r2,76
+ jmp.n r1
+ or r2,r0,0
+
+ENTRY(_longjmp)
+ ld r14,r2,8
+ ld r15,r2,12
+ ld r16,r2,16
+ ld r17,r2,20
+ ld r18,r2,24
+ ld r19,r2,28
+ ld r20,r2,32
+ ld r21,r2,36
+ ld r22,r2,40
+ ld r23,r2,44
+ ld r24,r2,48
+ ld r25,r2,52
+ ld r26,r2,56
+ ld r27,r2,60
+ ld r28,r2,64
+ ld r29,r2,68
+ ld r30,r2,72
+ ld r31,r2,76
+ 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/m88k/gen/fabs.S b/lib/libc/arch/m88k/gen/fabs.S
new file mode 100644
index 00000000000..810ccf30ef3
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/flt_rounds.c b/lib/libc/arch/m88k/gen/flt_rounds.c
new file mode 100644
index 00000000000..c3f6e4f2c58
--- /dev/null
+++ b/lib/libc/arch/m88k/gen/flt_rounds.c
@@ -0,0 +1,27 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ */
+
+#include <sys/types.h>
+#include <machine/float.h>
+
+/*
+ * 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/m88k/gen/fpgetmask.c b/lib/libc/arch/m88k/gen/fpgetmask.c
new file mode 100644
index 00000000000..832fe0de567
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/fpgetround.c b/lib/libc/arch/m88k/gen/fpgetround.c
new file mode 100644
index 00000000000..4edac881ff9
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/fpgetsticky.c b/lib/libc/arch/m88k/gen/fpgetsticky.c
new file mode 100644
index 00000000000..6d5bdc7bbde
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/fpsetmask.c b/lib/libc/arch/m88k/gen/fpsetmask.c
new file mode 100644
index 00000000000..42d88a7f641
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/fpsetround.c b/lib/libc/arch/m88k/gen/fpsetround.c
new file mode 100644
index 00000000000..417eefefa87
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/fpsetsticky.c b/lib/libc/arch/m88k/gen/fpsetsticky.c
new file mode 100644
index 00000000000..2c3f4c8c6d8
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/gen/frexp.c b/lib/libc/arch/m88k/gen/frexp.c
new file mode 100644
index 00000000000..68a208d01d8
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:30 smurph 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/m88k/gen/infinity.c b/lib/libc/arch/m88k/gen/infinity.c
new file mode 100644
index 00000000000..5d63ff87b44
--- /dev/null
+++ b/lib/libc/arch/m88k/gen/infinity.c
@@ -0,0 +1,10 @@
+#ifndef lint
+static char rcsid[] = "$Id: infinity.c,v 1.1 1998/12/15 07:10:30 smurph 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/m88k/gen/isinf.c b/lib/libc/arch/m88k/gen/isinf.c
new file mode 100644
index 00000000000..7d4be7e6bc3
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:30 smurph 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/m88k/gen/isnan.c b/lib/libc/arch/m88k/gen/isnan.c
new file mode 100644
index 00000000000..2ad50f1bddd
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:31 smurph 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/m88k/gen/ldexp.c b/lib/libc/arch/m88k/gen/ldexp.c
new file mode 100644
index 00000000000..0da4f5f365c
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:31 smurph 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/m88k/gen/modf.c b/lib/libc/arch/m88k/gen/modf.c
new file mode 100644
index 00000000000..aa3853bad7e
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:31 smurph 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/m88k/gen/setjmp.S b/lib/libc/arch/m88k/gen/setjmp.S
new file mode 100644
index 00000000000..9fc8988311d
--- /dev/null
+++ b/lib/libc/arch/m88k/gen/setjmp.S
@@ -0,0 +1,61 @@
+#include "SYS.h"
+
+ENTRY(setjmp)
+ st r1, r2,0
+ st r14,r2,8
+ st r15,r2,12
+ st r16,r2,16
+ st r17,r2,20
+ st r18,r2,24
+ st r19,r2,28
+ st r20,r2,32
+ st r21,r2,36
+ st r22,r2,40
+ st r23,r2,44
+ st r24,r2,48
+ st r25,r2,52
+ st r26,r2,56
+ st r27,r2,60
+ st r28,r2,64
+ st r29,r2,68
+ st r30,r2,72
+ st r31,r2,76
+ 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 r14,r2,8
+ ld r15,r2,12
+ ld r16,r2,16
+ ld r17,r2,20
+ ld r18,r2,24
+ ld r19,r2,28
+ ld r20,r2,32
+ ld r21,r2,36
+ ld r22,r2,40
+ ld r23,r2,44
+ ld r24,r2,48
+ ld r25,r2,52
+ ld r26,r2,56
+ ld r27,r2,60
+ ld r28,r2,64
+ ld r29,r2,68
+
+ st r2,r31,24 /* save r2 on stack */
+ st r3,r31,28 /* save r3 on stack */
+ bsr.n _sigsetmask
+ ld r2,r2,4
+ ld r2,r31,24 /* restore r2 from stack */
+ ld r3,r31,28 /* restore r3 from stack */
+ ld r30,r2,72 /* restore r30 */
+ ld r31,r2,76 /* restore 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/m88k/gen/sigsetjmp.S b/lib/libc/arch/m88k/gen/sigsetjmp.S
new file mode 100644
index 00000000000..44637c0c25a
--- /dev/null
+++ b/lib/libc/arch/m88k/gen/sigsetjmp.S
@@ -0,0 +1,64 @@
+#include "SYS.h"
+
+/*
+ * Need to write sigsetjmp version. But for now,
+ * I am copying setjmp XXX nivas
+ */
+ENTRY(sigsetjmp)
+ st r1, r2,0
+ st r14,r2,8
+ st r15,r2,12
+ st r16,r2,16
+ st r17,r2,20
+ st r18,r2,24
+ st r19,r2,28
+ st r20,r2,32
+ st r21,r2,36
+ st r22,r2,40
+ st r23,r2,44
+ st r24,r2,48
+ st r25,r2,52
+ st r26,r2,56
+ st r27,r2,60
+ st r28,r2,64
+ st r29,r2,68
+ st r30,r2,72
+ st r31,r2,76
+ 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 r14,r2,8
+ ld r15,r2,12
+ ld r16,r2,16
+ ld r17,r2,20
+ ld r18,r2,24
+ ld r19,r2,28
+ ld r20,r2,32
+ ld r21,r2,36
+ ld r22,r2,40
+ ld r23,r2,44
+ ld r24,r2,48
+ ld r25,r2,52
+ ld r26,r2,56
+ ld r27,r2,60
+ ld r28,r2,64
+ ld r29,r2,68
+
+ st r2,r31,24 /* save r2 on stack */
+ st r3,r31,28 /* save r3 on stack */
+ bsr.n _sigsetmask
+ ld r2,r2,4
+ ld r2,r31,24 /* restore r2 from stack */
+ ld r3,r31,28 /* restore r3 from stack */
+ ld r30,r2,72 /* restore r30 */
+ ld r31,r2,76 /* restore 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/m88k/net/Makefile.inc b/lib/libc/arch/m88k/net/Makefile.inc
new file mode 100644
index 00000000000..dc2ddf344cc
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/net/htonl.S b/lib/libc/arch/m88k/net/htonl.S
new file mode 100644
index 00000000000..fad085a24fc
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:31 smurph Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* netorder = htonl(hostorder) */
+
+#include "DEFS.h"
+
+ENTRY(htonl)
+ jmp r1
diff --git a/lib/libc/arch/m88k/net/htons.S b/lib/libc/arch/m88k/net/htons.S
new file mode 100644
index 00000000000..5a917d05cea
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:32 smurph 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/m88k/net/ntohl.S b/lib/libc/arch/m88k/net/ntohl.S
new file mode 100644
index 00000000000..7408fd068cb
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:32 smurph Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = ntohl(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(ntohl)
+ jmp r1
diff --git a/lib/libc/arch/m88k/net/ntohs.S b/lib/libc/arch/m88k/net/ntohs.S
new file mode 100644
index 00000000000..e9a298c2261
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:32 smurph 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/m88k/string/Makefile.inc b/lib/libc/arch/m88k/string/Makefile.inc
new file mode 100644
index 00000000000..86cf0d0710f
--- /dev/null
+++ b/lib/libc/arch/m88k/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/m88k/string/strchr.co b/lib/libc/arch/m88k/string/strchr.co
new file mode 100644
index 00000000000..8624920e6ae
--- /dev/null
+++ b/lib/libc/arch/m88k/string/strchr.co
@@ -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.co,v 1.1 1998/12/15 07:10:32 smurph 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/m88k/string/strrchr.co b/lib/libc/arch/m88k/string/strrchr.co
new file mode 100644
index 00000000000..a1439f3c28e
--- /dev/null
+++ b/lib/libc/arch/m88k/string/strrchr.co
@@ -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.co,v 1.1 1998/12/15 07:10:32 smurph 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/m88k/sys/Ovfork.S b/lib/libc/arch/m88k/sys/Ovfork.S
new file mode 100644
index 00000000000..2fab02ee275
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:32 smurph 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/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S
new file mode 100644
index 00000000000..39c39cabeb1
--- /dev/null
+++ b/lib/libc/arch/m88k/sys/brk.S
@@ -0,0 +1,71 @@
+/*-
+ * 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 1998/12/15 07:10:32 smurph Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl minbrk
+ .globl curbrk
+
+ .data
+ .align 2
+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/m88k/sys/cerror.S b/lib/libc/arch/m88k/sys/cerror.S
new file mode 100644
index 00000000000..91c70125b41
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:32 smurph 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/m88k/sys/exect.S b/lib/libc/arch/m88k/sys/exect.S
new file mode 100644
index 00000000000..55d4573b6b0
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/fork.S b/lib/libc/arch/m88k/sys/fork.S
new file mode 100644
index 00000000000..37c3f1069fd
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/pipe.S b/lib/libc/arch/m88k/sys/pipe.S
new file mode 100644
index 00000000000..720dbed8787
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/ptrace.S b/lib/libc/arch/m88k/sys/ptrace.S
new file mode 100644
index 00000000000..bc2b52b71d1
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/reboot.S b/lib/libc/arch/m88k/sys/reboot.S
new file mode 100644
index 00000000000..8af1a53eb23
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/sbrk.S b/lib/libc/arch/m88k/sys/sbrk.S
new file mode 100644
index 00000000000..1c31ed627eb
--- /dev/null
+++ b/lib/libc/arch/m88k/sys/sbrk.S
@@ -0,0 +1,74 @@
+/*-
+ * 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 1998/12/15 07:10:33 smurph Exp $"
+ .text
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl curbrk
+
+ .data
+/*
+curbrk: .long 0
+*/
+ .align 2
+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/m88k/sys/setlogin.S b/lib/libc/arch/m88k/sys/setlogin.S
new file mode 100644
index 00000000000..fb58b25ecf8
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/sigpending.S b/lib/libc/arch/m88k/sys/sigpending.S
new file mode 100644
index 00000000000..64be49369f7
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:33 smurph 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/m88k/sys/sigprocmask.S b/lib/libc/arch/m88k/sys/sigprocmask.S
new file mode 100644
index 00000000000..47e0a6107dd
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:34 smurph 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/m88k/sys/sigreturn.S b/lib/libc/arch/m88k/sys/sigreturn.S
new file mode 100644
index 00000000000..57fcce0b450
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:34 smurph 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/m88k/sys/sigsuspend.S b/lib/libc/arch/m88k/sys/sigsuspend.S
new file mode 100644
index 00000000000..7aaa524545d
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:34 smurph 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/m88k/sys/syscall.S b/lib/libc/arch/m88k/sys/syscall.S
new file mode 100644
index 00000000000..60d5386c02f
--- /dev/null
+++ b/lib/libc/arch/m88k/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 1998/12/15 07:10:34 smurph 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