summaryrefslogtreecommitdiff
path: root/lib/libc/arch/vax
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
commitd6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch)
treeece253b876159b39c620e62b6c9b1174642e070e /lib/libc/arch/vax
initial import of NetBSD tree
Diffstat (limited to 'lib/libc/arch/vax')
-rw-r--r--lib/libc/arch/vax/DEFS.h62
-rw-r--r--lib/libc/arch/vax/SYS.h52
-rw-r--r--lib/libc/arch/vax/gen/Makefile.inc4
-rw-r--r--lib/libc/arch/vax/gen/_setjmp.S102
-rw-r--r--lib/libc/arch/vax/gen/alloca.S50
-rw-r--r--lib/libc/arch/vax/gen/fabs.S48
-rw-r--r--lib/libc/arch/vax/gen/frexp.c67
-rw-r--r--lib/libc/arch/vax/gen/infinity.c13
-rw-r--r--lib/libc/arch/vax/gen/isinf.c51
-rw-r--r--lib/libc/arch/vax/gen/ldexp.S90
-rw-r--r--lib/libc/arch/vax/gen/modf.S56
-rw-r--r--lib/libc/arch/vax/gen/setjmp.S97
-rw-r--r--lib/libc/arch/vax/gen/udiv.S96
-rw-r--r--lib/libc/arch/vax/gen/urem.S96
-rw-r--r--lib/libc/arch/vax/net/Makefile.inc3
-rw-r--r--lib/libc/arch/vax/net/htonl.S47
-rw-r--r--lib/libc/arch/vax/net/htons.S47
-rw-r--r--lib/libc/arch/vax/net/ntohl.S47
-rw-r--r--lib/libc/arch/vax/net/ntohs.S47
-rw-r--r--lib/libc/arch/vax/string/Makefile.inc6
-rw-r--r--lib/libc/arch/vax/sys/Ovfork.S72
-rw-r--r--lib/libc/arch/vax/sys/brk.S57
-rw-r--r--lib/libc/arch/vax/sys/cerror.S45
-rw-r--r--lib/libc/arch/vax/sys/exect.S45
-rw-r--r--lib/libc/arch/vax/sys/fork.S45
-rw-r--r--lib/libc/arch/vax/sys/pipe.S46
-rw-r--r--lib/libc/arch/vax/sys/ptrace.S47
-rw-r--r--lib/libc/arch/vax/sys/reboot.S42
-rw-r--r--lib/libc/arch/vax/sys/sbrk.S62
-rw-r--r--lib/libc/arch/vax/sys/setlogin.S45
-rw-r--r--lib/libc/arch/vax/sys/sigpending.S44
-rw-r--r--lib/libc/arch/vax/sys/sigprocmask.S58
-rw-r--r--lib/libc/arch/vax/sys/sigreturn.S52
-rw-r--r--lib/libc/arch/vax/sys/sigsuspend.S49
-rw-r--r--lib/libc/arch/vax/sys/syscall.S53
35 files changed, 1843 insertions, 0 deletions
diff --git a/lib/libc/arch/vax/DEFS.h b/lib/libc/arch/vax/DEFS.h
new file mode 100644
index 00000000000..2473550fa75
--- /dev/null
+++ b/lib/libc/arch/vax/DEFS.h
@@ -0,0 +1,62 @@
+/* $NetBSD: DEFS.h,v 1.1 1995/04/17 12:23:33 ragge Exp $ */
+/*
+ * Copyright (c) 1982, 1993
+ * 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.
+ *
+ * @(#)DEFS.h 8.1 (Berkeley) 6/4/93
+ */
+
+#define R0 0x001
+#define R1 0x002
+#define R2 0x004
+#define R3 0x008
+#define R4 0x010
+#define R5 0x020
+#define R6 0x040
+#define R7 0x080
+#define R8 0x100
+#define R9 0x200
+#define R10 0x400
+#define R11 0x800
+
+#ifdef PROF
+#define ENTRY(x, regs) \
+ .globl _ ## x ## ; .align 2; _ ## x ## : .word regs; \
+ .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount
+#define ASENTRY(x, regs) \
+ .globl x; .align 2; x ## : .word regs; \
+ .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount
+#else
+#define ENTRY(x, regs) \
+ .globl _ ## x; .align 2; _ ## x ## : .word regs
+#define ASENTRY(x, regs) \
+ .globl x; .align 2; x ## : .word regs
+#endif
diff --git a/lib/libc/arch/vax/SYS.h b/lib/libc/arch/vax/SYS.h
new file mode 100644
index 00000000000..8057b70a969
--- /dev/null
+++ b/lib/libc/arch/vax/SYS.h
@@ -0,0 +1,52 @@
+/* $NetBSD: SYS.h,v 1.1 1995/04/17 12:23:34 ragge Exp $ */
+/*
+ * Copyright (c) 1983, 1993
+ * 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.
+ *
+ * @(#)SYS.h 8.1 (Berkeley) 6/4/93
+ */
+
+#include <sys/syscall.h>
+
+#ifdef PROF
+#define ENTRY(x) .globl _ ## x; .align 2; _ ## x ## : .word 0; \
+ .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount
+#else
+#define ENTRY(x) .globl _ ## x; .align 2; _ ## x ## : .word 0
+#endif PROF
+#define SYSCALL(x) err: jmp cerror; ENTRY(x); chmk $ SYS_ ## x; jcs err
+#define RSYSCALL(x) SYSCALL(x); ret
+#define PSEUDO(x,y) ENTRY(x); chmk $ SYS_ ## y; ret
+#define CALL(x,y) calls $ ## x, _ ## y
+
+#define ASMSTR .asciz
+
+ .globl cerror
diff --git a/lib/libc/arch/vax/gen/Makefile.inc b/lib/libc/arch/vax/gen/Makefile.inc
new file mode 100644
index 00000000000..9be4a93fec1
--- /dev/null
+++ b/lib/libc/arch/vax/gen/Makefile.inc
@@ -0,0 +1,4 @@
+# $NetBSD: Makefile.inc,v 1.1 1995/04/17 12:23:36 ragge Exp $
+
+SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.c ldexp.S \
+ modf.S setjmp.S udiv.S urem.S alloca.S
diff --git a/lib/libc/arch/vax/gen/_setjmp.S b/lib/libc/arch/vax/gen/_setjmp.S
new file mode 100644
index 00000000000..dc69060289f
--- /dev/null
+++ b/lib/libc/arch/vax/gen/_setjmp.S
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 1980, 1993
+ * 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)
+ /* .asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: _setjmp.S,v 1.1 1995/04/17 12:23:37 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * C library -- _setjmp, _longjmp
+ *
+ * _longjmp(a,v)
+ * will generate a "return(v)" from
+ * the last call to
+ * _setjmp(a)
+ * by restoring registers from the stack,
+ * The previous signal state is NOT restored.
+ */
+
+#include "DEFS.h"
+
+ENTRY(_setjmp, 0)
+ movl 4(ap),r0
+ movl 12(fp),(r0) # save frame pointer of caller
+ movl 16(fp),4(r0) # save pc of caller
+ clrl r0
+ ret
+
+ENTRY(_longjmp, 0)
+ movl 8(ap),r0 # return(v)
+ movl 4(ap),r1 # fetch buffer
+ tstl (r1)
+ beql botch
+loop:
+ bitw $1,6(fp) # r0 saved?
+ beql 1f
+ movl r0,20(fp)
+ bitw $2,6(fp) # was r1 saved?
+ beql 2f
+ movl r1,24(fp)
+ brb 2f
+1:
+ bitw $2,6(fp) # was r1 saved?
+ beql 2f
+ movl r1,20(fp)
+2:
+ cmpl (r1),12(fp)
+ beql done
+ blssu botch
+ movl $loop,16(fp)
+ ret # pop another frame
+
+done:
+ cmpb *16(fp),reiins # returning to an "rei"?
+ bneq 1f
+ movab 3f,16(fp) # do return w/ psl-pc pop
+ brw 2f
+1:
+ movab 4f,16(fp) # do standard return
+2:
+ ret # unwind stack before signals enabled
+3:
+ addl2 $8,sp # compensate for PSL-PC push
+4:
+ jmp *4(r1) # done, return....
+
+botch:
+ calls $0,_longjmperror
+ halt
+
+ .data
+reiins: rei
diff --git a/lib/libc/arch/vax/gen/alloca.S b/lib/libc/arch/vax/gen/alloca.S
new file mode 100644
index 00000000000..a1f47915d23
--- /dev/null
+++ b/lib/libc/arch/vax/gen/alloca.S
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * 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)
+ /* .asciz "@(#)alloca.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: alloca.S,v 1.1 1995/04/17 12:23:38 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+#include "DEFS.h"
+
+ENTRY(alloca, 0)
+ movl 4(ap),r0 # get allocation size
+ movl 16(fp),r2 # save return address before we smash it
+ movab here,16(fp)
+ ret
+here:
+ subl2 r0,sp # create stack space
+ bicl2 $3,sp # align to longword boundary
+ movl sp,r0
+ jmp (r2)
diff --git a/lib/libc/arch/vax/gen/fabs.S b/lib/libc/arch/vax/gen/fabs.S
new file mode 100644
index 00000000000..b50bd9aab2e
--- /dev/null
+++ b/lib/libc/arch/vax/gen/fabs.S
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)fabs.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: fabs.S,v 1.1 1995/04/17 12:23:39 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* fabs - floating absolute value */
+
+#include "DEFS.h"
+
+ENTRY(fabs, 0)
+ movd 4(ap),r0
+ bgeq 1f
+ mnegd r0,r0
+1:
+ ret
diff --git a/lib/libc/arch/vax/gen/frexp.c b/lib/libc/arch/vax/gen/frexp.c
new file mode 100644
index 00000000000..80d5a359bcd
--- /dev/null
+++ b/lib/libc/arch/vax/gen/frexp.c
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * 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[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93"; */
+static char rcsid[] = "$NetBSD: frexp.c,v 1.1 1995/04/17 12:23:40 ragge Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <math.h>
+
+double
+frexp(value, eptr)
+ double value;
+ int *eptr;
+{
+ union {
+ double v;
+ struct {
+ u_int u_mant1 : 7;
+ u_int u_exp : 8;
+ u_int u_sign : 1;
+ u_int u_mant2 : 16;
+ u_int u_mant3 : 32;
+ } s;
+ } u;
+
+ if (value) {
+ u.v = value;
+ *eptr = u.s.u_exp - 128;
+ u.s.u_exp = 128;
+ return(u.v);
+ } else {
+ *eptr = 0;
+ return((double)0);
+ }
+}
diff --git a/lib/libc/arch/vax/gen/infinity.c b/lib/libc/arch/vax/gen/infinity.c
new file mode 100644
index 00000000000..1193b65bc7a
--- /dev/null
+++ b/lib/libc/arch/vax/gen/infinity.c
@@ -0,0 +1,13 @@
+#ifndef lint
+static char rcsid[] = "$Id: infinity.c,v 1.1 1995/10/18 08:41:43 deraadt Exp $";
+#endif /* not lint */
+/*
+ * XXX - THIS IS (probably) COMPLETELY WRONG ON VAX!!!
+ */
+
+/* infinity.c */
+
+#include <math.h>
+
+/* bytes for +Infinity on a 387 */
+char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
diff --git a/lib/libc/arch/vax/gen/isinf.c b/lib/libc/arch/vax/gen/isinf.c
new file mode 100644
index 00000000000..7bacdb07d46
--- /dev/null
+++ b/lib/libc/arch/vax/gen/isinf.c
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * 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[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; */
+static char rcsid[] = "$NetBSD: isinf.c,v 1.1 1995/04/17 12:23:43 ragge Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* ARGSUSED */
+isnan(d)
+ double d;
+{
+ return(0);
+}
+
+/* ARGSUSED */
+isinf(d)
+ double d;
+{
+ return(0);
+}
diff --git a/lib/libc/arch/vax/gen/ldexp.S b/lib/libc/arch/vax/gen/ldexp.S
new file mode 100644
index 00000000000..8875fcd3e81
--- /dev/null
+++ b/lib/libc/arch/vax/gen/ldexp.S
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /*.asciz "@(#)ldexp.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: ldexp.S,v 1.2 1995/06/01 01:11:41 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * double ldexp (value, exp)
+ * double value;
+ * int exp;
+ *
+ * Ldexp returns value*2**exp, if that result is in range.
+ * If underflow occurs, it returns zero. If overflow occurs,
+ * it returns a value of appropriate sign and largest
+ * possible magnitude. In case of either overflow or underflow,
+ * errno is set to ERANGE. Note that errno is not modified if
+ * no error occurs.
+ */
+
+#include "DEFS.h"
+
+/*
+ * don't include errno.h, ANSI C says it defines errno.
+ *
+ * #include <errno.h>
+ */
+#define ERANGE 34
+
+ .globl _errno
+
+ENTRY(ldexp, 0)
+ movd 4(ap),r0 /* fetch "value" */
+ extzv $7,$8,r0,r2 /* r2 := biased exponent */
+ jeql 1f /* if zero, done */
+
+ addl2 12(ap),r2 /* r2 := new biased exponent */
+ jleq 2f /* if <= 0, underflow */
+ cmpl r2,$256 /* otherwise check if too big */
+ jgeq 3f /* jump if overflow */
+ insv r2,$7,$8,r0 /* put exponent back in result */
+1:
+ ret
+2:
+ clrd r0
+ jbr 1f
+3:
+ movd huge,r0 /* largest possible floating magnitude */
+ jbc $15,4(ap),1f /* jump if argument was positive */
+ mnegd r0,r0 /* if arg < 0, make result negative */
+1:
+ movl $ ERANGE,_errno
+ ret
+
+ .data
+huge: .word 0x7fff /* the largest number that can */
+ .word 0xffff /* be represented in a long floating */
+ .word 0xffff /* number. This is given in hex in order */
+ .word 0xffff /* to avoid floating conversions */
diff --git a/lib/libc/arch/vax/gen/modf.S b/lib/libc/arch/vax/gen/modf.S
new file mode 100644
index 00000000000..26b9cb501cc
--- /dev/null
+++ b/lib/libc/arch/vax/gen/modf.S
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)modf.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: modf.S,v 1.1 1995/04/17 12:23:45 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * double modf (value, iptr)
+ * double value, *iptr;
+ *
+ * Modf returns the fractional part of "value",
+ * and stores the integer part indirectly through "iptr".
+ */
+
+#include "DEFS.h"
+
+ENTRY(modf, 0)
+ emodd 4(ap),$0,$0f1.0,r2,r0
+ jvs 1f # integer overflow
+ cvtld r2,*12(ap)
+ ret
+1:
+ subd3 r0,4(ap),*12(ap)
+ ret
diff --git a/lib/libc/arch/vax/gen/setjmp.S b/lib/libc/arch/vax/gen/setjmp.S
new file mode 100644
index 00000000000..789b7e29963
--- /dev/null
+++ b/lib/libc/arch/vax/gen/setjmp.S
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)setjmp.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: setjmp.S,v 1.1 1995/04/17 12:23:46 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * C library -- setjmp, longjmp
+ *
+ * longjmp(a,v)
+ * will generate a "return(v)" from
+ * the last call to
+ * setjmp(a)
+ * by restoring registers from the stack,
+ * and a struct sigcontext, see <signal.h>
+ */
+
+#include "DEFS.h"
+
+ENTRY(setjmp, R6)
+ movl 4(ap),r6 # construct sigcontext
+ subl2 $12,sp # space for current struct sigstack
+ pushl sp # get current values
+ pushl $0 # no new values
+ calls $4,_sigaltstack # pop args plus signal stack value
+ movl (sp)+,(r6)+ # save onsigstack status of caller
+ pushl $0
+ calls $1,_sigblock # get signal mask
+ movl r0,(r6)+ # save signal mask of caller
+ movl (ap),r0
+ moval 4(ap)[r0],(r6)+ # save sp of caller
+ movl 12(fp),(r6)+ # save frame pointer of caller
+ movl 8(fp),(r6)+ # save argument pointer of caller
+ movl 16(fp),(r6)+ # save pc of caller
+ movpsl (r6) # save psl of caller
+ movw 4(fp),(r6)
+ clrl r0
+ ret
+
+ENTRY(longjmp, 0)
+ movl 8(ap),r0 # return(v)
+ movl 4(ap),r1 # fetch buffer
+ tstl 12(r1)
+ beql botch
+loop:
+ cmpl 12(r1),fp # are we there yet?
+ beql done
+ blssu botch
+ moval 20(fp),r2
+ blbc 6(fp),1f # was r0 saved?
+ movl r0,(r2)+
+1:
+ bbc $1,6(fp),2f # was r1 saved?
+ movl r1,(r2)
+2:
+ movl $loop,16(fp)
+ ret # pop another frame
+
+done:
+ pushl r1 # pointer to sigcontext
+ calls $1,_sigreturn # restore previous context
+ # we should never return
+botch:
+ calls $0,_longjmperror
+ halt
diff --git a/lib/libc/arch/vax/gen/udiv.S b/lib/libc/arch/vax/gen/udiv.S
new file mode 100644
index 00000000000..dc42f2fe752
--- /dev/null
+++ b/lib/libc/arch/vax/gen/udiv.S
@@ -0,0 +1,96 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Donn Seeley at UUNET Technologies, Inc.
+ *
+ * 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)
+ /* .asciz "@(#)udiv.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: udiv.S,v 1.1 1995/04/17 12:23:47 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Unsigned division, PCC flavor.
+ * udiv() takes an ordinary dividend/divisor pair;
+ * audiv() takes a pointer to a dividend and an ordinary divisor.
+ */
+
+#include "DEFS.h"
+
+#define DIVIDEND 4(ap)
+#define DIVISOR 8(ap)
+
+ASENTRY(udiv,0)
+ movl DIVISOR,r2
+ jlss Leasy # big divisor: settle by comparison
+ movl DIVIDEND,r0
+ jlss Lhard # big dividend: extended division
+ divl2 r2,r0 # small divisor and dividend: signed division
+ ret
+Lhard:
+ clrl r1
+ ediv r2,r0,r0,r1
+ ret
+Leasy:
+ cmpl DIVIDEND,r2
+ jgequ Lone # if dividend is as big or bigger, return 1
+ clrl r0 # else return 0
+ ret
+Lone:
+ movl $1,r0
+ ret
+
+ASENTRY(audiv,0)
+ movl DIVIDEND,r3
+ movl DIVISOR,r2
+ jlss La_easy # big divisor: settle by comparison
+ movl (r3),r0
+ jlss La_hard # big dividend: extended division
+ divl2 r2,r0 # small divisor and dividend: signed division
+ movl r0,(r3) # leave the value of the assignment in r0
+ ret
+La_hard:
+ clrl r1
+ ediv r2,r0,r0,r1
+ movl r0,(r3)
+ ret
+La_easy:
+ cmpl (r3),r2
+ jgequ La_one # if dividend is as big or bigger, return 1
+ clrl r0 # else return 0
+ clrl (r3)
+ ret
+La_one:
+ movl $1,r0
+ movl r0,(r3)
+ ret
diff --git a/lib/libc/arch/vax/gen/urem.S b/lib/libc/arch/vax/gen/urem.S
new file mode 100644
index 00000000000..615b065ace4
--- /dev/null
+++ b/lib/libc/arch/vax/gen/urem.S
@@ -0,0 +1,96 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Donn Seeley at UUNET Technologies, Inc.
+ *
+ * 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)
+ /* .asciz "@(#)urem.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: urem.S,v 1.1 1995/04/17 12:23:48 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+#include "DEFS.h"
+
+/*
+ * Unsigned modulus, PCC flavor.
+ * urem() takes an ordinary dividend/divisor pair;
+ * aurem() takes a pointer to a dividend and an ordinary divisor.
+ */
+
+#define DIVIDEND 4(ap)
+#define DIVISOR 8(ap)
+
+ASENTRY(urem,0)
+ movl DIVISOR,r2
+ jlss Leasy # big divisor: settle by comparison
+ movl DIVIDEND,r0
+ jlss Lhard # big dividend: need extended division
+ divl3 r2,r0,r1 # small divisor and dividend: signed modulus
+ mull2 r2,r1
+ subl2 r1,r0
+ ret
+Lhard:
+ clrl r1
+ ediv r2,r0,r1,r0
+ ret
+Leasy:
+ subl3 r2,DIVIDEND,r0
+ jcc Ldifference # if divisor goes in once, return difference
+ movl DIVIDEND,r0 # if divisor is bigger, return dividend
+Ldifference:
+ ret
+
+ASENTRY(aurem,0)
+ movl DIVIDEND,r3
+ movl DIVISOR,r2
+ jlss La_easy # big divisor: settle by comparison
+ movl (r3),r0
+ jlss La_hard # big dividend: need extended division
+ divl3 r2,r0,r1 # small divisor and dividend: signed modulus
+ mull2 r2,r1
+ subl2 r1,r0
+ movl r0,(r3) # leave the value of the assignment in r0
+ ret
+La_hard:
+ clrl r1
+ ediv r2,r0,r1,r0
+ movl r0,(r3)
+ ret
+La_easy:
+ subl3 r2,(r3),r0
+ jcs La_dividend # if divisor is bigger, leave dividend alone
+ movl r0,(r3) # if divisor goes in once, store difference
+ ret
+La_dividend:
+ movl (r3),r0
+ ret
diff --git a/lib/libc/arch/vax/net/Makefile.inc b/lib/libc/arch/vax/net/Makefile.inc
new file mode 100644
index 00000000000..309dbeb3974
--- /dev/null
+++ b/lib/libc/arch/vax/net/Makefile.inc
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 1995/04/17 12:23:49 ragge Exp $
+
+SRCS+= htonl.S htons.S ntohl.S ntohs.S
diff --git a/lib/libc/arch/vax/net/htonl.S b/lib/libc/arch/vax/net/htonl.S
new file mode 100644
index 00000000000..f707e2b40db
--- /dev/null
+++ b/lib/libc/arch/vax/net/htonl.S
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)htonl.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: htonl.S,v 1.1 1995/04/17 12:23:50 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* netorder = htonl(hostorder) */
+
+#include "DEFS.h"
+
+ENTRY(htonl, 0)
+ rotl $-8,4(ap),r0
+ insv r0,$16,$8,r0
+ movb 7(ap),r0
+ ret
diff --git a/lib/libc/arch/vax/net/htons.S b/lib/libc/arch/vax/net/htons.S
new file mode 100644
index 00000000000..deab20f1142
--- /dev/null
+++ b/lib/libc/arch/vax/net/htons.S
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)htons.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: htons.S,v 1.1 1995/04/17 12:23:51 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = htons(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(htons, 0)
+ rotl $8,4(ap),r0
+ movb 5(ap),r0
+ movzwl r0,r0
+ ret
diff --git a/lib/libc/arch/vax/net/ntohl.S b/lib/libc/arch/vax/net/ntohl.S
new file mode 100644
index 00000000000..5ad5314bf5b
--- /dev/null
+++ b/lib/libc/arch/vax/net/ntohl.S
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)ntohl.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: ntohl.S,v 1.1 1995/04/17 12:23:52 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = ntohl(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(ntohl, 0)
+ rotl $-8,4(ap),r0
+ insv r0,$16,$8,r0
+ movb 7(ap),r0
+ ret
diff --git a/lib/libc/arch/vax/net/ntohs.S b/lib/libc/arch/vax/net/ntohs.S
new file mode 100644
index 00000000000..9a4dc34e743
--- /dev/null
+++ b/lib/libc/arch/vax/net/ntohs.S
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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)
+ /* .asciz "@(#)ntohs.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: ntohs.S,v 1.1 1995/04/17 12:23:53 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+/* hostorder = ntohs(netorder) */
+
+#include "DEFS.h"
+
+ENTRY(ntohs, 0)
+ rotl $8,4(ap),r0
+ movb 5(ap),r0
+ movzwl r0,r0
+ ret
diff --git a/lib/libc/arch/vax/string/Makefile.inc b/lib/libc/arch/vax/string/Makefile.inc
new file mode 100644
index 00000000000..7afdc23ce9c
--- /dev/null
+++ b/lib/libc/arch/vax/string/Makefile.inc
@@ -0,0 +1,6 @@
+# $NetBSD: Makefile.inc,v 1.1 1995/04/17 12:23:55 ragge Exp $
+
+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
diff --git a/lib/libc/arch/vax/sys/Ovfork.S b/lib/libc/arch/vax/sys/Ovfork.S
new file mode 100644
index 00000000000..8ed3bc3bfc0
--- /dev/null
+++ b/lib/libc/arch/vax/sys/Ovfork.S
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)Ovfork.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: Ovfork.S,v 1.1 1995/04/17 12:23:56 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+/*
+ * @(#)vfork.s 4.1 (Berkeley) 12/21/80
+ * C library -- vfork
+ */
+
+#include "SYS.h"
+
+/*
+ * pid = vfork();
+ *
+ * r1 == 0 in parent process, r1 == 1 in child process.
+ * r0 == pid of child in parent, r0 == pid of parent in child.
+ *
+ * trickery here, due to keith sklower, uses ret to clear the stack,
+ * and then returns with a jump indirect, since only one person can return
+ * with a ret off this stack... we do the ret before we vfork!
+ */
+
+ENTRY(vfork)
+ movl 16(fp),r2 # save return address before we smash it
+ movab here,16(fp)
+ ret
+here:
+ chmk $ SYS_vfork
+ bcs err # if failed, set errno and return -1
+ /* this next trick is Chris Torek's fault */
+ mnegl r1,r1 # r1 = 0xffffffff if child, 0 if parent
+ bicl2 r1,r0 # r0 &= ~r1, i.e., 0 if child, else unchanged
+ jmp (r2)
+
+err:
+ movl r0,_errno
+ mnegl $1,r0
+ jmp (r2)
diff --git a/lib/libc/arch/vax/sys/brk.S b/lib/libc/arch/vax/sys/brk.S
new file mode 100644
index 00000000000..1f95813a92f
--- /dev/null
+++ b/lib/libc/arch/vax/sys/brk.S
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)brk.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: brk.S,v 1.1 1995/04/17 12:23:58 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl curbrk
+ .globl minbrk
+ENTRY(_brk)
+ jbr ok
+
+ENTRY(brk)
+ cmpl 4(ap),minbrk
+ bgeq ok
+ movl minbrk,4(ap)
+ok:
+ chmk $ SYS_break
+ jcs err
+ movl 4(ap),curbrk
+ clrl r0
+ ret
+err:
+ jmp cerror
diff --git a/lib/libc/arch/vax/sys/cerror.S b/lib/libc/arch/vax/sys/cerror.S
new file mode 100644
index 00000000000..18f50f8e46e
--- /dev/null
+++ b/lib/libc/arch/vax/sys/cerror.S
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)cerror.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: cerror.S,v 1.1 1995/04/17 12:23:59 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _errno
+cerror:
+ movl r0,_errno
+ mnegl $1,r0
+ ret
diff --git a/lib/libc/arch/vax/sys/exect.S b/lib/libc/arch/vax/sys/exect.S
new file mode 100644
index 00000000000..dce5babf6bf
--- /dev/null
+++ b/lib/libc/arch/vax/sys/exect.S
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)exect.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: exect.S,v 1.1 1995/04/17 12:24:00 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+#include <machine/psl.h>
+
+ENTRY(exect)
+ bispsw $PSL_T
+ chmk $ SYS_execve
+ jmp cerror # exect(file, argv, env)
diff --git a/lib/libc/arch/vax/sys/fork.S b/lib/libc/arch/vax/sys/fork.S
new file mode 100644
index 00000000000..05d6e34471a
--- /dev/null
+++ b/lib/libc/arch/vax/sys/fork.S
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)fork.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: fork.S,v 1.1 1995/04/17 12:24:01 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(fork)
+ jlbc r1,1f # parent, since r1 == 0 in parent, 1 in child
+ clrl r0
+1:
+ ret # pid = fork()
diff --git a/lib/libc/arch/vax/sys/pipe.S b/lib/libc/arch/vax/sys/pipe.S
new file mode 100644
index 00000000000..4e9018f8a10
--- /dev/null
+++ b/lib/libc/arch/vax/sys/pipe.S
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: pipe.S,v 1.1 1995/04/17 12:24:02 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(pipe)
+ movl 4(ap),r2
+ movl r0,(r2)+
+ movl r1,(r2)
+ clrl r0
+ ret
diff --git a/lib/libc/arch/vax/sys/ptrace.S b/lib/libc/arch/vax/sys/ptrace.S
new file mode 100644
index 00000000000..13055124d55
--- /dev/null
+++ b/lib/libc/arch/vax/sys/ptrace.S
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)ptrace.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: ptrace.S,v 1.1 1995/04/17 12:24:03 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(ptrace)
+ clrl _errno
+ chmk $ SYS_ptrace
+ jcs err
+ ret
+err:
+ jmp cerror
diff --git a/lib/libc/arch/vax/sys/reboot.S b/lib/libc/arch/vax/sys/reboot.S
new file mode 100644
index 00000000000..a4ae1304d78
--- /dev/null
+++ b/lib/libc/arch/vax/sys/reboot.S
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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.
+ */
+
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ /* ASMSTR "@(#)reboot.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: reboot.S,v 1.1 1995/04/17 12:24:04 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+SYSCALL(reboot)
+ halt
diff --git a/lib/libc/arch/vax/sys/sbrk.S b/lib/libc/arch/vax/sys/sbrk.S
new file mode 100644
index 00000000000..99a8fe2e7bb
--- /dev/null
+++ b/lib/libc/arch/vax/sys/sbrk.S
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)sbrk.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: sbrk.S,v 1.1 1995/04/17 12:24:05 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+
+ .globl _end
+ .globl minbrk
+ .globl curbrk
+
+ .data
+minbrk: .long _end
+curbrk: .long _end
+ .text
+
+ENTRY(sbrk)
+ addl3 curbrk,4(ap),-(sp)
+ pushl $1
+ movl ap,r3
+ movl sp,ap
+ chmk $ SYS_break
+ jcs err
+ movl curbrk,r0
+ addl2 4(r3),curbrk
+ ret
+err:
+ jmp cerror
diff --git a/lib/libc/arch/vax/sys/setlogin.S b/lib/libc/arch/vax/sys/setlogin.S
new file mode 100644
index 00000000000..ac6616eb880
--- /dev/null
+++ b/lib/libc/arch/vax/sys/setlogin.S
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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.
+ */
+
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ /* ASMSTR "@(#)setlogin.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: setlogin.S,v 1.1 1995/04/17 12:24:06 ragge Exp $"
+#endif /* LIBC_SCCS and not lint */
+
+.globl ___logname_valid /* in getlogin() */
+
+SYSCALL(setlogin)
+ movl $0,___logname_valid
+ ret /* setlogin(name); */
diff --git a/lib/libc/arch/vax/sys/sigpending.S b/lib/libc/arch/vax/sys/sigpending.S
new file mode 100644
index 00000000000..8095be85178
--- /dev/null
+++ b/lib/libc/arch/vax/sys/sigpending.S
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1989, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)sigpending.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: sigpending.S,v 1.1 1995/04/17 12:24:07 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(sigpending)
+ movl r0,*4(ap) # store old mask
+ clrl r0
+ ret
diff --git a/lib/libc/arch/vax/sys/sigprocmask.S b/lib/libc/arch/vax/sys/sigprocmask.S
new file mode 100644
index 00000000000..4dc0f04454c
--- /dev/null
+++ b/lib/libc/arch/vax/sys/sigprocmask.S
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 1989, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)sigprocmask.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: sigprocmask.S,v 1.1 1995/04/17 12:24:08 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+err:
+ jmp cerror
+
+ENTRY(sigprocmask)
+ tstl 8(ap) # check new sigset pointer
+ bneq 1f # if not null, indirect
+/* movl $0,8(ap) # null mask pointer: block empty set */
+ movl $1,4(ap) # SIG_BLOCK
+ jbr 2f
+1: movl *8(ap),8(ap) # indirect to new mask arg
+2: chmk $ SYS_sigprocmask
+ jcs err
+ tstl 12(ap) # test if old mask requested
+ beql out
+ movl r0,*12(ap) # store old mask
+out:
+ clrl r0
+ ret
diff --git a/lib/libc/arch/vax/sys/sigreturn.S b/lib/libc/arch/vax/sys/sigreturn.S
new file mode 100644
index 00000000000..a6d7db65388
--- /dev/null
+++ b/lib/libc/arch/vax/sys/sigreturn.S
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1983, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)sigreturn.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: sigreturn.S,v 1.1 1995/04/17 12:24:09 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/*
+ * We must preserve the state of the registers as the user has set them up.
+ */
+#ifdef PROF
+#undef ENTRY
+#define ENTRY(x) \
+ .globl _ ## x; .align 2; _ ## x ## : .word 0; pushr $0x3f; \
+ .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount; popr $0x3f;
+#endif PROF
+
+SYSCALL(sigreturn)
+ ret
diff --git a/lib/libc/arch/vax/sys/sigsuspend.S b/lib/libc/arch/vax/sys/sigsuspend.S
new file mode 100644
index 00000000000..3233abc5f12
--- /dev/null
+++ b/lib/libc/arch/vax/sys/sigsuspend.S
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1989, 1993
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)sigsuspend.s 8.1 (Berkeley) 6/4/93" */
+ .asciz "$NetBSD: sigsuspend.S,v 1.1 1995/04/17 12:24:10 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+err:
+ jmp cerror
+
+ENTRY(sigsuspend)
+ movl *4(ap),4(ap) # indirect to mask arg
+ chmk $ SYS_sigsuspend
+ jcs err
+ clrl r0 # shouldnt happen
+ ret
diff --git a/lib/libc/arch/vax/sys/syscall.S b/lib/libc/arch/vax/sys/syscall.S
new file mode 100644
index 00000000000..9b5b1ec5b59
--- /dev/null
+++ b/lib/libc/arch/vax/sys/syscall.S
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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(SYSLIBC_SCCS) && !defined(lint)
+ /* .asciz "@(#)syscall.s 8.2 (Berkeley) 1/21/94" */
+ .asciz "$NetBSD: syscall.S,v 1.1 1995/04/17 12:24:11 ragge Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(syscall)
+ movl 4(ap),r0 # syscall number
+ subl3 $1,(ap)+,(ap) # one fewer arguments
+ chmk r0
+ jcs 1f
+ ret
+1:
+ jmp cerror