summaryrefslogtreecommitdiff
path: root/lib/libc/arch/i386/sys
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/i386/sys
initial import of NetBSD tree
Diffstat (limited to 'lib/libc/arch/i386/sys')
-rw-r--r--lib/libc/arch/i386/sys/Ovfork.S72
-rw-r--r--lib/libc/arch/i386/sys/brk.S94
-rw-r--r--lib/libc/arch/i386/sys/cerror.S59
-rw-r--r--lib/libc/arch/i386/sys/exect.S60
-rw-r--r--lib/libc/arch/i386/sys/fork.S50
-rw-r--r--lib/libc/arch/i386/sys/pipe.S52
-rw-r--r--lib/libc/arch/i386/sys/ptrace.S66
-rw-r--r--lib/libc/arch/i386/sys/reboot.S48
-rw-r--r--lib/libc/arch/i386/sys/sbrk.S87
-rw-r--r--lib/libc/arch/i386/sys/setlogin.S58
-rw-r--r--lib/libc/arch/i386/sys/sigpending.S51
-rw-r--r--lib/libc/arch/i386/sys/sigprocmask.S71
-rw-r--r--lib/libc/arch/i386/sys/sigreturn.S58
-rw-r--r--lib/libc/arch/i386/sys/sigsuspend.S61
-rw-r--r--lib/libc/arch/i386/sys/syscall.S60
15 files changed, 947 insertions, 0 deletions
diff --git a/lib/libc/arch/i386/sys/Ovfork.S b/lib/libc/arch/i386/sys/Ovfork.S
new file mode 100644
index 00000000000..d422697448b
--- /dev/null
+++ b/lib/libc/arch/i386/sys/Ovfork.S
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
+ * $Id: Ovfork.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: Ovfork.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+/*
+ * pid = vfork();
+ *
+ * %edx == 0 in parent process, %edx == 1 in child process.
+ * %eax == pid of child in parent, %eax == pid of parent in child.
+ *
+ */
+ENTRY(vfork)
+ popl %ecx /* my rta into ecx */
+ movl $(SYS_vfork),%eax
+ int $0x80
+ jc err
+ decl %edx
+ andl %edx,%eax
+ jmp %ecx
+err:
+#ifdef PIC
+ PIC_PROLOGUE
+ movl PIC_GOT(_errno),%edx
+ PIC_EPILOGUE
+ movl %eax,(%edx)
+#else
+ movl %eax,_errno
+#endif
+ movl $-1,%eax
+ jmp %ecx
diff --git a/lib/libc/arch/i386/sys/brk.S b/lib/libc/arch/i386/sys/brk.S
new file mode 100644
index 00000000000..9b363c4efc2
--- /dev/null
+++ b/lib/libc/arch/i386/sys/brk.S
@@ -0,0 +1,94 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)brk.s 5.2 (Berkeley) 12/17/90
+ * $Id: brk.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: brk.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl minbrk
+ .globl curbrk
+
+ .data
+minbrk: .long _end
+ .text
+
+ENTRY(brk)
+#ifdef PIC
+ movl 4(%esp),%ecx
+ PIC_PROLOGUE
+ movl PIC_GOT(minbrk),%edx
+ PIC_EPILOGUE
+ cmpl %ecx,(%edx)
+ jl 1f
+ movl (%edx),%ecx
+ movl %ecx,4(%esp)
+1:
+ movl $(SYS_break),%eax
+ int $0x80
+ jc err
+ PIC_PROLOGUE
+ movl PIC_GOT(curbrk),%edx # set up GOT addressing
+ PIC_EPILOGUE
+ xorl %eax,%eax
+ movl %ecx,(%edx)
+ ret
+err:
+ jmp PIC_PLT(cerror)
+
+#else
+
+ movl 4(%esp),%ecx
+ cmpl %ecx,minbrk
+ jl 1f
+ movl minbrk,%ecx
+ movl %ecx,4(%esp)
+1:
+ movl $(SYS_break),%eax
+ int $0x80
+ jc err
+ xorl %eax,%eax
+ movl %ecx,curbrk
+ ret
+err:
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/cerror.S b/lib/libc/arch/i386/sys/cerror.S
new file mode 100644
index 00000000000..7294a64c39d
--- /dev/null
+++ b/lib/libc/arch/i386/sys/cerror.S
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)cerror.s 5.1 (Berkeley) 4/23/90
+ * $Id: cerror.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: cerror.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _errno
+cerror:
+#ifdef PIC
+ PIC_PROLOGUE
+ movl PIC_GOT(_errno),%ecx
+ PIC_EPILOGUE
+ movl %eax,(%ecx)
+#else
+ movl %eax,_errno
+#endif
+ movl $-1,%eax
+ movl $-1,%edx
+ ret
diff --git a/lib/libc/arch/i386/sys/exect.S b/lib/libc/arch/i386/sys/exect.S
new file mode 100644
index 00000000000..3036d69c7b8
--- /dev/null
+++ b/lib/libc/arch/i386/sys/exect.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)exect.s 5.1 (Berkeley) 4/23/90
+ * $Id: exect.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: exect.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+#include <machine/psl.h>
+
+ENTRY(exect)
+ movl $(SYS_execve),%eax
+ pushf
+ popl %edx
+ orl $(PSL_T),%edx
+ pushl %edx
+ popf
+ int $0x80
+#ifdef PIC
+ jmp PIC_PLT(cerror) /* exect(file, argv, env); */
+#else
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/fork.S b/lib/libc/arch/i386/sys/fork.S
new file mode 100644
index 00000000000..d92180e5f39
--- /dev/null
+++ b/lib/libc/arch/i386/sys/fork.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)fork.s 5.1 (Berkeley) 4/23/90
+ * $Id: fork.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: fork.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(fork)
+ decl %edx /* from 1 to 0 in child, 0 to -1 in parent */
+ andl %edx,%eax
+ ret /* pid = fork(); */
diff --git a/lib/libc/arch/i386/sys/pipe.S b/lib/libc/arch/i386/sys/pipe.S
new file mode 100644
index 00000000000..4ddb2fb9f82
--- /dev/null
+++ b/lib/libc/arch/i386/sys/pipe.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)pipe.s 5.1 (Berkeley) 4/23/90
+ * $Id: pipe.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: pipe.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(pipe)
+ movl 4(%esp),%ecx
+ movl %eax,(%ecx)
+ movl %edx,4(%ecx)
+ xorl %eax,%eax
+ ret
diff --git a/lib/libc/arch/i386/sys/ptrace.S b/lib/libc/arch/i386/sys/ptrace.S
new file mode 100644
index 00000000000..5dba39b64e5
--- /dev/null
+++ b/lib/libc/arch/i386/sys/ptrace.S
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)ptrace.s 5.1 (Berkeley) 4/23/90
+ * $Id: ptrace.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: ptrace.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(ptrace)
+#ifdef PIC
+ xorl %eax,%eax
+ PIC_PROLOGUE
+ movl PIC_GOT(_errno),%edx
+ PIC_EPILOGUE
+ movl %eax,(%edx)
+#else
+ movl $0,_errno
+#endif
+ movl $(SYS_ptrace),%eax
+ int $0x80
+ jc err
+ ret
+err:
+#ifdef PIC
+ jmp PIC_PLT(cerror)
+#else
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/reboot.S b/lib/libc/arch/i386/sys/reboot.S
new file mode 100644
index 00000000000..f3df195f99f
--- /dev/null
+++ b/lib/libc/arch/i386/sys/reboot.S
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)reboot.s 5.1 (Berkeley) 4/23/90
+ * $Id: reboot.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: reboot.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(reboot)
+ iret
diff --git a/lib/libc/arch/i386/sys/sbrk.S b/lib/libc/arch/i386/sys/sbrk.S
new file mode 100644
index 00000000000..6cdd6b84bee
--- /dev/null
+++ b/lib/libc/arch/i386/sys/sbrk.S
@@ -0,0 +1,87 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sbrk.s 5.1 (Berkeley) 4/23/90
+ * $Id: sbrk.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: sbrk.S,v 1.1 1995/10/18 08:41:26 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ .globl _end
+ .globl curbrk
+
+ .data
+curbrk: .long _end
+ .text
+
+ENTRY(sbrk)
+#ifdef PIC
+ movl 4(%esp),%ecx
+ PIC_PROLOGUE
+ movl PIC_GOT(curbrk),%edx
+ PIC_EPILOGUE
+ movl (%edx),%eax
+ addl %eax,4(%esp)
+ movl $(SYS_break),%eax
+ int $0x80
+ jc err
+ PIC_PROLOGUE
+ movl PIC_GOT(curbrk),%edx
+ PIC_EPILOGUE
+ movl (%edx),%eax
+ addl %ecx,(%edx)
+ ret
+err:
+ jmp PIC_PLT(cerror)
+
+#else
+
+ movl 4(%esp),%ecx
+ movl curbrk,%eax
+ addl %eax,4(%esp)
+ movl $(SYS_break),%eax
+ int $0x80
+ jc err
+ movl curbrk,%eax
+ addl %ecx,curbrk
+ ret
+err:
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/setlogin.S b/lib/libc/arch/i386/sys/setlogin.S
new file mode 100644
index 00000000000..e090422fd08
--- /dev/null
+++ b/lib/libc/arch/i386/sys/setlogin.S
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)setlogin.s 5.2 (Berkeley) 4/12/91
+ * $Id: setlogin.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(LIBC_SCCS)
+ .text
+ .asciz "$Id: setlogin.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $"
+#endif
+
+#include "SYS.h"
+
+ .globl ___logname_valid /* in getlogin() */
+SYSCALL(setlogin)
+ xorl %eax,%eax
+#ifdef PIC
+ PIC_PROLOGUE
+ movl PIC_GOT(___logname_valid),%edx
+ PIC_EPILOGUE
+ movl %eax,(%edx)
+#else
+ movl %eax,___logname_valid
+#endif
+ ret /* setlogin(name) */
diff --git a/lib/libc/arch/i386/sys/sigpending.S b/lib/libc/arch/i386/sys/sigpending.S
new file mode 100644
index 00000000000..51c07a236df
--- /dev/null
+++ b/lib/libc/arch/i386/sys/sigpending.S
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sigpending.s 5.1 (Berkeley) 7/1/90
+ * $Id: sigpending.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: sigpending.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+SYSCALL(sigpending)
+ movl 4(%esp),%ecx # fetch pointer to...
+ movl %eax,(%ecx) # store old mask
+ xorl %eax,%eax
+ ret
diff --git a/lib/libc/arch/i386/sys/sigprocmask.S b/lib/libc/arch/i386/sys/sigprocmask.S
new file mode 100644
index 00000000000..353c8de2217
--- /dev/null
+++ b/lib/libc/arch/i386/sys/sigprocmask.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sigprocmask.s 5.2 (Berkeley) 12/17/90
+ * $Id: sigprocmask.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: sigprocmask.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(sigprocmask)
+ movl 8(%esp),%ecx # fetch new sigset pointer
+ testl %ecx,%ecx # check new sigset pointer
+ jnz 1f # if not null, indirect
+/* movl $0,8(%esp) # null mask pointer: block empty set */
+ movl $1,4(%esp) # SIG_BLOCK
+ jmp 2f
+1: movl (%ecx),%ecx # fetch indirect ...
+ movl %ecx,8(%esp) # to new mask arg
+2: movl $(SYS_sigprocmask),%eax
+ int $0x80
+ jc err
+ movl 12(%esp),%ecx # fetch old mask requested
+ testl %ecx,%ecx # test if old mask requested
+ jz out
+ movl %eax,(%ecx) # store old mask
+out:
+ xorl %eax,%eax
+ ret
+err:
+#ifdef PIC
+ jmp PIC_PLT(cerror)
+#else
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/sigreturn.S b/lib/libc/arch/i386/sys/sigreturn.S
new file mode 100644
index 00000000000..1059d2dfa8c
--- /dev/null
+++ b/lib/libc/arch/i386/sys/sigreturn.S
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sigreturn.s 5.2 (Berkeley) 12/17/90"
+ * $Id: sigreturn.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: sigreturn.S,v 1.1 1995/10/18 08:41:27 deraadt 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: pusha ; \
+ .data; 1:; .long 0; .text; movl $1b,%eax; call mcount; popa ; nop
+#endif /* PROF */
+
+SYSCALL(sigreturn)
+ ret
diff --git a/lib/libc/arch/i386/sys/sigsuspend.S b/lib/libc/arch/i386/sys/sigsuspend.S
new file mode 100644
index 00000000000..5f0e2df7966
--- /dev/null
+++ b/lib/libc/arch/i386/sys/sigsuspend.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sigsuspend.s 5.2 (Berkeley) 12/17/90
+ * $Id: sigsuspend.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: sigsuspend.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(sigsuspend)
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend),%eax
+ int $0x80
+ jc err
+ xorl %eax,%eax # shouldn t happen
+ ret
+err:
+#ifdef PIC
+ jmp PIC_PLT(cerror)
+#else
+ jmp cerror
+#endif
diff --git a/lib/libc/arch/i386/sys/syscall.S b/lib/libc/arch/i386/sys/syscall.S
new file mode 100644
index 00000000000..962aeeb1074
--- /dev/null
+++ b/lib/libc/arch/i386/sys/syscall.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
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)syscall.s 5.1 (Berkeley) 4/23/90
+ * $Id: syscall.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $
+ */
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .text
+ .asciz "$Id: syscall.S,v 1.1 1995/10/18 08:41:27 deraadt Exp $"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+ENTRY(syscall)
+ pop %ecx /* rta */
+ pop %eax /* syscall number */
+ push %ecx
+ int $0x80
+ push %ecx /* Keep stack frame consistant */
+ jc err
+ ret
+err:
+#ifdef PIC
+ jmp PIC_PLT(cerror)
+#else
+ jmp cerror
+#endif