diff --git a/lib/libc/arch/alpha/sys/pipe.S b/lib/libc/arch/alpha/sys/pipe.S deleted file mode 100644 index cddc812c59f4..000000000000 --- a/lib/libc/arch/alpha/sys/pipe.S +++ /dev/null @@ -1,42 +0,0 @@ -/* $NetBSD: pipe.S,v 1.4 2001/05/07 17:19:18 kleink Exp $ */ - -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -LEAF(_pipe, 0) - CALLSYS_ERROR(pipe) - stl v0, 0(a0) - stl a4, 4(a0) - mov zero, v0 - RET -END(_pipe) diff --git a/lib/libc/arch/arm/sys/pipe.S b/lib/libc/arch/arm/sys/pipe.S deleted file mode 100644 index cc0d98b011ee..000000000000 --- a/lib/libc/arch/arm/sys/pipe.S +++ /dev/null @@ -1,47 +0,0 @@ -/* $NetBSD: pipe.S,v 1.8 2013/08/16 22:21:59 matt Exp $ */ - -/*- - * Copyright (c) 1990 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. 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 - */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mov r2, r0 - SYSTRAP(pipe) - _INVOKE_CERROR() - stmia r2!, {r0-r1} - movs r0, #0 - RET -END(_pipe) diff --git a/lib/libc/arch/hppa/sys/pipe.S b/lib/libc/arch/hppa/sys/pipe.S deleted file mode 100644 index 00970ae79d15..000000000000 --- a/lib/libc/arch/hppa/sys/pipe.S +++ /dev/null @@ -1,58 +0,0 @@ -/* $NetBSD: pipe.S,v 1.3 2003/10/06 05:30:21 matt Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. 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) -#if 0 - RCSID("from: @(#)pipe.s 5.1 (Berkeley) 5/12/90") -#else - RCSID("$NetBSD: pipe.S,v 1.3 2003/10/06 05:30:21 matt Exp $") -#endif -#endif /* LIBC_SCCS and not lint */ - -#ifdef WEAK_ALIAS - WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe,0) - stw %arg0, HPPA_FRAME_ARG(0)(%sp) - SYSCALL(pipe) - ldw HPPA_FRAME_ARG(0)(%sp), %arg0 - stw %ret0, 0(%arg0) - stw %ret1, 4(%arg0) - bv %r0(%rp) - copy %r0, %ret0 -EXIT(_pipe) diff --git a/lib/libc/arch/i386/sys/pipe.S b/lib/libc/arch/i386/sys/pipe.S deleted file mode 100644 index f6b30bf9b963..000000000000 --- a/lib/libc/arch/i386/sys/pipe.S +++ /dev/null @@ -1,54 +0,0 @@ -/* $NetBSD: pipe.S,v 1.7 2014/05/23 02:34:19 uebayasi Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. 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 - */ - -#include -#if defined(SYSLIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: pipe.S,v 1.7 2014/05/23 02:34:19 uebayasi Exp $") -#endif /* SYSLIBC_SCCS and not lint */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -_SYSCALL(_pipe,pipe) - movl 4(%esp),%ecx - movl %eax,(%ecx) - movl %edx,4(%ecx) - xorl %eax,%eax - ret -END(_pipe) diff --git a/lib/libc/arch/ia64/sys/pipe.S b/lib/libc/arch/ia64/sys/pipe.S deleted file mode 100644 index e545e5a509c9..000000000000 --- a/lib/libc/arch/ia64/sys/pipe.S +++ /dev/null @@ -1,50 +0,0 @@ -/* $NetBSD: pipe.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */ - -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include -/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/pipe.S,v 1.4 2003/05/16 21:26:39 marcel Exp $"); */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif -/* XXX: Relook param passing */ - -ENTRY(_pipe, 1) - st8 [sp]=r32 - CALLSYS_ERROR(pipe) - ld8 r14=[sp] - ;; - st4 [r14]=ret0,4 - ;; - st4 [r14]=ret1 - mov ret0=0 - br.ret.sptk.few rp -END(_pipe) diff --git a/lib/libc/arch/m68k/sys/pipe.S b/lib/libc/arch/m68k/sys/pipe.S deleted file mode 100644 index 37960a3c1b98..000000000000 --- a/lib/libc/arch/m68k/sys/pipe.S +++ /dev/null @@ -1,56 +0,0 @@ -/* $NetBSD: pipe.S,v 1.8 2013/07/16 22:16:53 matt Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. 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) -#if 0 - RCSID("from: @(#)pipe.s 5.1 (Berkeley) 5/12/90") -#else - RCSID("$NetBSD: pipe.S,v 1.8 2013/07/16 22:16:53 matt Exp $") -#endif -#endif /* LIBC_SCCS and not lint */ - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -_SYSCALL(_pipe,pipe) - movl 4(%sp),%a0 - movl %d0,(%a0)+ - movl %d1,(%a0) - clrl %d0 - rts -END(_pipe) diff --git a/lib/libc/arch/mips/sys/pipe.S b/lib/libc/arch/mips/sys/pipe.S deleted file mode 100644 index d4047e241d56..000000000000 --- a/lib/libc/arch/mips/sys/pipe.S +++ /dev/null @@ -1,61 +0,0 @@ -/* $NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $ */ - -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * 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. 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) -#if 0 - RCSID("from: @(#)pipe.s 8.1 (Berkeley) 6/4/93") -#else - RCSID("$NetBSD: pipe.S,v 1.12 2009/12/14 01:07:42 matt Exp $") -#endif -#endif /* LIBC_SCCS and not lint */ - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -LEAF(_pipe) - PIC_PROLOGUE(_pipe); - - SYSTRAP(pipe) # pipe(fildes) int fildes[2]; - - bne a3, zero, 1f - INT_S v0, 0(a0) # store the two file descriptors - INT_S v1, 4(a0) - move v0, zero - PIC_RETURN() -1: - PIC_TAILCALL(__cerror) -END(_pipe) diff --git a/lib/libc/arch/or1k/sys/pipe.S b/lib/libc/arch/or1k/sys/pipe.S deleted file mode 100644 index b6eb7988eb07..000000000000 --- a/lib/libc/arch/or1k/sys/pipe.S +++ /dev/null @@ -1,23 +0,0 @@ -/* $NetBSD: pipe.S,v 1.1 2014/09/03 19:34:26 matt Exp $ */ - -#include "SYS.h" - -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pipe.S,v 1.1 2014/09/03 19:34:26 matt Exp $") -#endif /* LIBC_SCCS && !lint */ - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - l.or r5,r3,r0 # save pointer - _DOSYSCALL(pipe) # assume, that r5 is kept - l.bf _C_LABEL(__cerror) - l.nop - l.sw 0(r5),r11 # success, store fds - l.sw 4(r5),r12 - l.xor r11,r11,r11 - l.jr lr # and return 0 - l.nop -END(_pipe) diff --git a/lib/libc/arch/powerpc/sys/pipe.S b/lib/libc/arch/powerpc/sys/pipe.S deleted file mode 100644 index 8d6f041e5cc8..000000000000 --- a/lib/libc/arch/powerpc/sys/pipe.S +++ /dev/null @@ -1,23 +0,0 @@ -/* $NetBSD: pipe.S,v 1.9 2014/08/23 02:24:22 matt Exp $ */ - -#include "SYS.h" - -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pipe.S,v 1.9 2014/08/23 02:24:22 matt Exp $") -#endif /* LIBC_SCCS && !lint */ - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mr %r5,%r3 # save pointer - _DOSYSCALL(pipe) # assume, that r5 is kept - bso 1f - stint %r3,0(%r5) # success, store fds - stint %r4,4(%r5) - li %r3,0 - blr # and return 0 -1: - BRANCH_TO_CERROR() -END(_pipe) diff --git a/lib/libc/arch/powerpc64/sys/pipe.S b/lib/libc/arch/powerpc64/sys/pipe.S deleted file mode 100644 index 2f66db9c640d..000000000000 --- a/lib/libc/arch/powerpc64/sys/pipe.S +++ /dev/null @@ -1,19 +0,0 @@ -/* $NetBSD: pipe.S,v 1.2 2014/08/23 02:24:22 matt Exp $ */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mr %r5,%r3 # save pointer - _DOSYSCALL(pipe) # assume, that r5 is kept - bso 1f - stint %r3,0(%r5) # success, store fds - stint %r4,4(%r5) - li %r3,0 - blr # and return 0 -1: - BRANCH_TO_CERROR() -END(_pipe) diff --git a/lib/libc/arch/riscv/sys/pipe.S b/lib/libc/arch/riscv/sys/pipe.S deleted file mode 100644 index 34daef12f612..000000000000 --- a/lib/libc/arch/riscv/sys/pipe.S +++ /dev/null @@ -1,51 +0,0 @@ -/* $NetBSD: pipe.S,v 1.2 2015/03/27 06:44:28 matt Exp $ */ - -/*- - * Copyright (c) 2014 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Matt Thomas of 3am Software Foundry. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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) - RCSID("$NetBSD: pipe.S,v 1.2 2015/03/27 06:44:28 matt Exp $") -#endif /* LIBC_SCCS and not lint */ - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mv a2, a0 # a0 will be overwritten - SYSTRAP(pipe) # pipe(fildes) int fildes[2]; - JUMP_TO_CERROR() /* error */ - /* success */ - sw a0, 0(a2) # store the two file descriptors - sw a1, __SIZEOF_INT__(a2) - li a0, 0 - ret -END(_pipe) diff --git a/lib/libc/arch/sh3/sys/pipe.S b/lib/libc/arch/sh3/sys/pipe.S deleted file mode 100644 index 11c6b953bcde..000000000000 --- a/lib/libc/arch/sh3/sys/pipe.S +++ /dev/null @@ -1,52 +0,0 @@ -/* $NetBSD: pipe.S,v 1.7 2006/01/06 05:23:46 uwe Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. 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 - */ - -#include -#if defined(SYSLIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: pipe.S,v 1.7 2006/01/06 05:23:46 uwe Exp $") -#endif /* SYSLIBC_SCCS and not lint */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe,_pipe) -#endif - -_SYSCALL(_pipe,pipe) - mov.l r0, @r4 - mov.l r1, @(4, r4) - rts - mov #0, r0 diff --git a/lib/libc/arch/sparc/sys/pipe.S b/lib/libc/arch/sparc/sys/pipe.S deleted file mode 100644 index 457c713f3f88..000000000000 --- a/lib/libc/arch/sparc/sys/pipe.S +++ /dev/null @@ -1,63 +0,0 @@ -/* $NetBSD: pipe.S,v 1.4 2003/08/07 16:42:25 agc Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: Header: pipe.s,v 1.1 91/07/06 13:05:58 torek Exp - */ - -#include -#if defined(SYSLIBC_SCCS) && !defined(lint) -#if 0 - .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" -#else - RCSID("$NetBSD: pipe.S,v 1.4 2003/08/07 16:42:25 agc Exp $") -#endif -#endif /* SYSLIBC_SCCS and not lint */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mov %o0, %o2 ! save pointer - mov SYS_pipe, %g1 - t ST_SYSCALL ! pipe() - bcc,a 1f - st %o0, [%o2] ! success, store fds - ERROR() -1: - st %o1, [%o2 + 4] - retl ! and return 0 - clr %o0 diff --git a/lib/libc/arch/sparc64/sys/pipe.S b/lib/libc/arch/sparc64/sys/pipe.S deleted file mode 100644 index c0c6ecfc9613..000000000000 --- a/lib/libc/arch/sparc64/sys/pipe.S +++ /dev/null @@ -1,63 +0,0 @@ -/* $NetBSD: pipe.S,v 1.4 2003/08/07 16:42:30 agc Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: Header: pipe.s,v 1.1 91/07/06 13:05:58 torek Exp - */ - -#include -#if defined(SYSLIBC_SCCS) && !defined(lint) -#if 0 - .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" -#else - RCSID("$NetBSD: pipe.S,v 1.4 2003/08/07 16:42:30 agc Exp $") -#endif -#endif /* SYSLIBC_SCCS and not lint */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -ENTRY(_pipe) - mov %o0, %o2 /* save pointer */ - mov SYS_pipe, %g1 - t ST_SYSCALL /* pipe() */ - bcc,a 1f - st %o0, [%o2] /* success, store fds */ - ERROR() -1: - st %o1, [%o2 + 4] - retl /* and return 0 */ - clr %o0 diff --git a/lib/libc/arch/vax/sys/pipe.S b/lib/libc/arch/vax/sys/pipe.S deleted file mode 100644 index 60ded6aed33e..000000000000 --- a/lib/libc/arch/vax/sys/pipe.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. 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(SYSLIBC_SCCS) - /* .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" */ -RCSID("$NetBSD: pipe.S,v 1.5 2011/01/25 02:38:15 matt Exp $") -#endif - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -_SYSCALL(_pipe,pipe) - movl 4(%ap),%r2 - movl %r0,(%r2)+ - movl %r1,(%r2) - clrl %r0 - ret -END(_pipe) diff --git a/lib/libc/arch/x86_64/sys/pipe.S b/lib/libc/arch/x86_64/sys/pipe.S deleted file mode 100644 index 023c7800e8dd..000000000000 --- a/lib/libc/arch/x86_64/sys/pipe.S +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: pipe.S,v 1.3 2014/05/22 15:01:57 uebayasi Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. 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 - */ - -#include -#if defined(SYSLIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: pipe.S,v 1.3 2014/05/22 15:01:57 uebayasi Exp $") -#endif /* SYSLIBC_SCCS and not lint */ - -#include "SYS.h" - -#ifdef WEAK_ALIAS -WEAK_ALIAS(pipe, _pipe) -#endif - -_SYSCALL(_pipe,pipe) - movl %eax,(%rdi) - movl %edx,4(%rdi) - xorl %eax,%eax - ret -END(_pipe) diff --git a/lib/libc/sys/Lint_pipe.c b/lib/libc/sys/Lint_pipe.c deleted file mode 100644 index a86db166f822..000000000000 --- a/lib/libc/sys/Lint_pipe.c +++ /dev/null @@ -1,16 +0,0 @@ -/* $NetBSD: Lint_pipe.c,v 1.2 2000/06/14 06:49:10 cgd Exp $ */ - -/* - * This file placed in the public domain. - * Chris Demetriou, November 5, 1997. - */ - -#include - -/*ARGSUSED*/ -int -pipe(filedes) - int filedes[2]; -{ - return (0); -} diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index d61ee6c3c0ec..660e73db9b88 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -7,19 +7,19 @@ # other sources shared with the kernel, used in syscalls SRCS+= cpuset.c # glue to offer userland wrappers for some syscalls -SRCS+= posix_fadvise.c posix_madvise.c sched.c sigqueue.c sigtimedwait.c \ - sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c \ - clock_getcpuclockid.c accept4.c +SRCS+= accept4.c pipe.c clock_getcpuclockid.c posix_fadvise.c \ + posix_madvise.c sched.c sigqueue.c sigtimedwait.c \ + sigwait.c sigwaitinfo.c statvfs.c swapon.c semctl.c .if ${RUMPRUN} != "yes" # modules with non-default implementations on at least one architecture: -SRCS+= __clone.S __vfork14.S brk.S fork.S pipe.S \ +SRCS+= __clone.S __vfork14.S brk.S fork.S \ getcontext.S \ ptrace.S sbrk.S shmat.S \ syscall.S __syscall.S __clone.S cerror.S _LSRC+= Lint___clone.c Lint___vfork14.c Lint_brk.c Lint_clone.c \ - Lint_getcontext.c Lint_pipe.c Lint_ptrace.c \ + Lint_getcontext.c Lint_ptrace.c \ Lint_sbrk.c Lint___sigaction14.c Lint_syscall.c Lint___syscall.c \ LintSysNormal.c LintSysNoerr.c LintSysPseudoNoerr.c diff --git a/lib/libc/arch/aarch64/sys/pipe.S b/lib/libc/sys/pipe.c similarity index 78% rename from lib/libc/arch/aarch64/sys/pipe.S rename to lib/libc/sys/pipe.c index 878130a4ea4c..d700045758ad 100644 --- a/lib/libc/arch/aarch64/sys/pipe.S +++ b/lib/libc/sys/pipe.c @@ -1,12 +1,9 @@ -/* $NetBSD: pipe.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */ +/* $NetBSD$ */ /*- - * Copyright (c) 2014 The NetBSD Foundation, Inc. + * Copyright (c) 2017 The NetBSD Foundation, Inc. * All rights reserved. * - * This code is derived from software contributed to The NetBSD Foundation - * by Matt Thomas of 3am Software Foundry. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -29,15 +26,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "SYS.h" +#include +__RCSID("$NetBSD$"); + +#include "namespace.h" +#include + +#ifdef __weak_alias +__weak_alias(pipe,_pipe) +#endif -WEAK_ALIAS(pipe, _pipe) +int +pipe(int fildes[2]) +{ -ENTRY(_pipe) - mov x9, x0 - SYSTRAP(pipe) - _INVOKE_CERROR() - stp w0, w1, [x9] - mov w0, wzr - RET -END(_pipe) + return pipe2(fildes, 0); +} diff --git a/lib/librumphijack/hijack.c b/lib/librumphijack/hijack.c index 89bed4c6b563..ff7b16cb1ea2 100644 --- a/lib/librumphijack/hijack.c +++ b/lib/librumphijack/hijack.c @@ -2085,7 +2085,7 @@ REALPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, * should give a microbenchmark improvement (haven't * experienced a macro-level problem yet, though). */ - if ((rv = rump_sys_pipe(rpipe)) == -1) { + if ((rv = rump_sys_pipe2(rpipe, 0)) == -1) { sverrno = errno; } if (rv == 0 && (rv = pipe(hpipe)) == -1) { diff --git a/sys/compat/linux/arch/alpha/linux_pipe.c b/sys/compat/linux/arch/alpha/linux_pipe.c index eaa32af8e6e8..9a90658deb0f 100644 --- a/sys/compat/linux/arch/alpha/linux_pipe.c +++ b/sys/compat/linux/arch/alpha/linux_pipe.c @@ -62,12 +62,13 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.17 2014/11/09 17:48:07 maxv Exp $") int linux_sys_pipe(struct lwp *l, const void *v, register_t *retval) { - int error; + int fd[2], error; - if ((error = pipe1(l, retval, 0))) + if ((error = pipe1(l, fd, 0))) return error; - (l->l_md.md_tf)->tf_regs[FRAME_A4] = retval[1]; + retval[0] = fd[0]; + (l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1]; return 0; } @@ -79,16 +80,17 @@ linux_sys_pipe2(struct lwp *l, const struct linux_sys_pipe2_args *uap, syscallarg(int *) pfds; syscallarg(int) flags; } */ - int error, flags; + int fd[2], error, flags; flags = linux_to_bsd_ioflags(SCARG(uap, flags)); if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0) return EINVAL; - if ((error = pipe1(l, retval, flags))) + if ((error = pipe1(l, fd, flags))) return error; - (l->l_md.md_tf)->tf_regs[FRAME_A4] = retval[1]; + retval[0] = fd[0]; + (l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1]; return 0; } diff --git a/sys/compat/linux/common/linux_pipe.c b/sys/compat/linux/common/linux_pipe.c index 2f5a9ee9ea58..d570dffd0cb8 100644 --- a/sys/compat/linux/common/linux_pipe.c +++ b/sys/compat/linux/common/linux_pipe.c @@ -57,31 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.67 2014/11/09 17:48:08 maxv Exp $") /* Not used on: alpha, mips, sparc, sparc64 */ /* Alpha, mips, sparc and sparc64 pass one of the fds in a register */ -/* - * NetBSD passes fd[0] in retval[0], and fd[1] in retval[1]. - * Linux directly passes the pointer. - */ -static int -linux_pipe_return(struct lwp *l, int *pfds, register_t *retval) -{ - int error; - - if (sizeof(*retval) != sizeof(*pfds)) { - /* On amd64, sizeof(register_t) != sizeof(int) */ - int rpfds[2]; - rpfds[0] = (int)retval[0]; - rpfds[1] = (int)retval[1]; - - if ((error = copyout(rpfds, pfds, sizeof(rpfds)))) - return error; - } else { - if ((error = copyout(retval, pfds, 2 * sizeof(*pfds)))) - return error; - } - retval[0] = 0; - return 0; -} - int linux_sys_pipe(struct lwp *l, const struct linux_sys_pipe_args *uap, register_t *retval) @@ -89,12 +64,15 @@ linux_sys_pipe(struct lwp *l, const struct linux_sys_pipe_args *uap, /* { syscallarg(int *) pfds; } */ - int error; + int fd[2], error; - if ((error = pipe1(l, retval, 0))) + if ((error = pipe1(l, fd, 0))) return error; - return linux_pipe_return(l, SCARG(uap, pfds), retval); + if ((error = copyout(fd, SCARG(uap, pfds), sizeof(fd))) != 0) + return error; + retval[0] = 0; + return 0; } int @@ -105,14 +83,17 @@ linux_sys_pipe2(struct lwp *l, const struct linux_sys_pipe2_args *uap, syscallarg(int *) pfds; syscallarg(int) flags; } */ - int error, flags; + int fd[2], error, flags; flags = linux_to_bsd_ioflags(SCARG(uap, flags)); if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0) return EINVAL; - if ((error = pipe1(l, retval, flags))) + if ((error = pipe1(l, fd, flags))) return error; - return linux_pipe_return(l, SCARG(uap, pfds), retval); + if ((error = copyout(fd, SCARG(uap, pfds), sizeof(fd))) != 0) + return error; + retval[0] = 0; + return 0; } diff --git a/sys/compat/linux32/common/linux32_unistd.c b/sys/compat/linux32/common/linux32_unistd.c index a9f81fa22ff0..b3c19e70b35b 100644 --- a/sys/compat/linux32/common/linux32_unistd.c +++ b/sys/compat/linux32/common/linux32_unistd.c @@ -225,51 +225,44 @@ linux32_select1(struct lwp *l, register_t *retval, int nfds, return 0; } -static int -linux32_pipe(struct lwp *l, int *fd, register_t *retval) +int +linux32_sys_pipe(struct lwp *l, const struct linux32_sys_pipe_args *uap, + register_t *retval) { /* { syscallarg(netbsd32_intp) fd; } */ - int error; - int pfds[2]; - - pfds[0] = (int)retval[0]; - pfds[1] = (int)retval[1]; + int f[2], error; - if ((error = copyout(pfds, fd, 2 * sizeof(*fd))) != 0) + if ((error = pipe1(l, f, 0))) return error; + if ((error = copyout(f, SCARG_P32(uap, fd), sizeof(f))) != 0) + return error; retval[0] = 0; - retval[1] = 0; - return 0; } -int -linux32_sys_pipe(struct lwp *l, const struct linux32_sys_pipe_args *uap, - register_t *retval) -{ - int error; - if ((error = pipe1(l, retval, 0))) - return error; - return linux32_pipe(l, SCARG_P32(uap, fd), retval); -} - int linux32_sys_pipe2(struct lwp *l, const struct linux32_sys_pipe2_args *uap, register_t *retval) { - int flags, error; + /* { + syscallarg(netbsd32_intp) fd; + } */ + int f[2], flags, error; flags = linux_to_bsd_ioflags(SCARG(uap, flags)); if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0) return EINVAL; - if ((error = pipe1(l, retval, flags))) + if ((error = pipe1(l, f, flags))) return error; - return linux32_pipe(l, SCARG_P32(uap, fd), retval); + if ((error = copyout(f, SCARG_P32(uap, fd), sizeof(f))) != 0) + return error; + retval[0] = 0; + return 0; } int @@ -741,4 +734,3 @@ linux32_sys_pwrite(struct lwp *l, return sys_pwrite(l, &pra, retval); } - diff --git a/sys/compat/netbsd32/netbsd32_netbsd.c b/sys/compat/netbsd32/netbsd32_netbsd.c index d41053ebdcc4..736d072193ba 100644 --- a/sys/compat/netbsd32/netbsd32_netbsd.c +++ b/sys/compat/netbsd32/netbsd32_netbsd.c @@ -2687,13 +2687,10 @@ netbsd32_pipe2(struct lwp *l, const struct netbsd32_pipe2_args *uap, } */ int fd[2], error; - error = pipe1(l, retval, SCARG(uap, flags)); + error = pipe1(l, fd, SCARG(uap, flags)); if (error != 0) return error; - fd[0] = retval[0]; - fd[1] = retval[1]; - error = copyout(fd, SCARG_P32(uap, fildes), sizeof(fd)); if (error != 0) return error; diff --git a/sys/compat/netbsd32/netbsd32_syscall.h b/sys/compat/netbsd32/netbsd32_syscall.h index bcf3abf94899..4526361c9eca 100644 --- a/sys/compat/netbsd32/netbsd32_syscall.h +++ b/sys/compat/netbsd32/netbsd32_syscall.h @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.133 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.118 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.119 2017/12/19 19:40:03 kamil Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -136,8 +136,8 @@ /* syscall: "netbsd32_dup" ret: "int" args: "int" */ #define NETBSD32_SYS_netbsd32_dup 41 -/* syscall: "pipe" ret: "int" args: */ -#define NETBSD32_SYS_pipe 42 +/* syscall: "compat_80_pipe" ret: "int" args: */ +#define NETBSD32_SYS_compat_80_pipe 42 /* syscall: "getegid" ret: "gid_t" args: */ #define NETBSD32_SYS_getegid 43 diff --git a/sys/compat/netbsd32/netbsd32_syscallargs.h b/sys/compat/netbsd32/netbsd32_syscallargs.h index 033152f2164d..37c605d6dbdb 100644 --- a/sys/compat/netbsd32/netbsd32_syscallargs.h +++ b/sys/compat/netbsd32/netbsd32_syscallargs.h @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.133 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.118 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.119 2017/12/19 19:40:03 kamil Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2674,7 +2674,7 @@ int compat_43_netbsd32_lstat43(struct lwp *, const struct compat_43_netbsd32_lst int netbsd32_dup(struct lwp *, const struct netbsd32_dup_args *, register_t *); -int sys_pipe(struct lwp *, const void *, register_t *); +int compat_80_sys_pipe(struct lwp *, const void *, register_t *); int sys_getegid(struct lwp *, const void *, register_t *); diff --git a/sys/compat/netbsd32/netbsd32_syscalls.c b/sys/compat/netbsd32/netbsd32_syscalls.c index ad2f0d0a59eb..262b89d6ac5d 100644 --- a/sys/compat/netbsd32/netbsd32_syscalls.c +++ b/sys/compat/netbsd32/netbsd32_syscalls.c @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.131 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.118 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.119 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.131 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -70,7 +70,7 @@ const char *const netbsd32_syscallnames[] = { /* 39 */ "getppid", /* 40 */ "compat_43_netbsd32_lstat43", /* 41 */ "netbsd32_dup", - /* 42 */ "pipe", + /* 42 */ "compat_80_pipe", /* 43 */ "getegid", /* 44 */ "netbsd32_profil", /* 45 */ "netbsd32_ktrace", @@ -600,7 +600,7 @@ const char *const altnetbsd32_syscallnames[] = { /* 39 */ NULL, /* getppid */ /* 40 */ NULL, /* compat_43_netbsd32_lstat43 */ /* 41 */ "dup", - /* 42 */ NULL, /* pipe */ + /* 42 */ NULL, /* compat_80_pipe */ /* 43 */ NULL, /* getegid */ /* 44 */ "profil", /* 45 */ "ktrace", diff --git a/sys/compat/netbsd32/netbsd32_syscalls_autoload.c b/sys/compat/netbsd32/netbsd32_syscalls_autoload.c index 6e84cd4c5610..947f951f42cc 100644 --- a/sys/compat/netbsd32/netbsd32_syscalls_autoload.c +++ b/sys/compat/netbsd32/netbsd32_syscalls_autoload.c @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.12 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call autoload table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.118 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.119 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.12 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include static struct sc_autoload netbsd32_syscalls_autoload[] = { diff --git a/sys/compat/netbsd32/netbsd32_sysent.c b/sys/compat/netbsd32/netbsd32_sysent.c index 0c1dfb3dca59..953f084294d8 100644 --- a/sys/compat/netbsd32/netbsd32_sysent.c +++ b/sys/compat/netbsd32/netbsd32_sysent.c @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.131 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.118 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.119 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.131 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -113,6 +113,12 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.131 2017/12/19 19:40:03 kamil #define compat_70(func) sys_nosys #endif +#ifdef COMPAT_80 +#define compat_80(func) __CONCAT(compat_80_,func) +#else +#define compat_80(func) sys_nosys +#endif + #define s(type) sizeof(type) #define n(type) (sizeof(type)/sizeof (register32_t)) #define ns(type) .sy_narg = n(type), .sy_argsize = s(type) @@ -281,8 +287,8 @@ struct sysent netbsd32_sysent[] = { .sy_call = (sy_call_t *)netbsd32_dup }, /* 41 = netbsd32_dup */ { - .sy_call = (sy_call_t *)sys_pipe - }, /* 42 = pipe */ + .sy_call = (sy_call_t *)compat_80(sys_pipe) + }, /* 42 = compat_80_pipe */ { .sy_call = (sy_call_t *)sys_getegid }, /* 43 = getegid */ diff --git a/sys/compat/netbsd32/netbsd32_systrace_args.c b/sys/compat/netbsd32/netbsd32_systrace_args.c index 4e2f04c79633..3051f9a0dccb 100644 --- a/sys/compat/netbsd32/netbsd32_systrace_args.c +++ b/sys/compat/netbsd32/netbsd32_systrace_args.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_systrace_args.c,v 1.23 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array converstion. diff --git a/sys/compat/netbsd32/syscalls.conf b/sys/compat/netbsd32/syscalls.conf index b8cf12b24701..5c0cb22cc08d 100644 --- a/sys/compat/netbsd32/syscalls.conf +++ b/sys/compat/netbsd32/syscalls.conf @@ -6,7 +6,7 @@ syssw="netbsd32_sysent.c" sysarghdr="netbsd32_syscallargs.h" systrace="netbsd32_systrace_args.c" sysautoload="netbsd32_syscalls_autoload.c" -compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70" +compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80" libcompatopts="" switchname="netbsd32_sysent" diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master index d2d01aa7cb23..8c6c73ae493e 100644 --- a/sys/compat/netbsd32/syscalls.master +++ b/sys/compat/netbsd32/syscalls.master @@ -130,7 +130,7 @@ 40 COMPAT_43 { int|netbsd32||lstat43(netbsd32_charp path, \ netbsd32_stat43p_t ub); } 41 STD { int|netbsd32||dup(int fd); } -42 NOARGS { int|sys||pipe(void); } +42 COMPAT_80 { int|sys||pipe(void); } 43 NOARGS { gid_t|sys||getegid(void); } 44 STD { int|netbsd32||profil(netbsd32_voidp samples, \ netbsd32_size_t size, netbsd32_u_long offset, \ diff --git a/sys/conf/compat_netbsd80.config b/sys/conf/compat_netbsd80.config new file mode 100644 index 000000000000..c554b023657a --- /dev/null +++ b/sys/conf/compat_netbsd80.config @@ -0,0 +1,7 @@ +# $NetBSD: compat_netbsd70.config,v 1.1 2017/09/14 07:58:44 mrg Exp $ + +# Common fragment for all NetBSD targets wanting NetBSD 8.0 and newer +# compatibility support. + +include "conf/compat_netbsd.config" +options COMPAT_80 # NetBSD 8.0 and beyond. diff --git a/sys/conf/files b/sys/conf/files index e8f12e27cb7b..2098bcbe3efa 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -132,7 +132,8 @@ defflag opt_todr.h TODR_DEBUG # compatibility options # defflag opt_compat_netbsd.h COMPAT_NETBSD -defflag opt_compat_netbsd.h COMPAT_70: COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_80: COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_70: COMPAT_80, COMPAT_NETBSD defflag opt_compat_netbsd.h COMPAT_60: COMPAT_70, COMPAT_NETBSD defflag opt_compat_netbsd.h COMPAT_50: COMPAT_60, COMPAT_NETBSD defflag opt_compat_netbsd.h COMPAT_40: COMPAT_50, COMPAT_NETBSD diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 5578aae4c9bf..0d9a5910beba 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -1,14 +1,14 @@ -/* $NetBSD: init_sysent.c,v 1.318 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.318 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include "opt_modular.h" #include "opt_ntp.h" @@ -112,6 +112,12 @@ __KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.318 2017/12/19 19:40:03 kamil Exp #define compat_70(func) sys_nosys #endif +#ifdef COMPAT_80 +#define compat_80(func) __CONCAT(compat_80_,func) +#else +#define compat_80(func) sys_nosys +#endif + #define s(type) sizeof(type) #define n(type) (sizeof(type)/sizeof (register_t)) #define ns(type) .sy_narg = n(type), .sy_argsize = s(type) @@ -306,8 +312,8 @@ struct sysent sysent[] = { .sy_call = (sy_call_t *)sys_dup }, /* 41 = dup */ { - .sy_call = (sy_call_t *)sys_pipe - }, /* 42 = pipe */ + .sy_call = (sy_call_t *)sys_nomodule + }, /* 42 = compat_80_pipe */ { .sy_call = (sy_call_t *)sys_getegid }, /* 43 = getegid */ diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 9acb031127ba..a521c123b4d0 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -570,13 +570,6 @@ function parseline() { f++ fbase=$f - # pipe is special in how to returns its values. - # So just generate it manually if present. - if (rumpable == 1 && fbase == "pipe") { - rumpable = 0; - rumphaspipe = 1; - } - if (fcompat != "") { funcname=fprefix "___" fbase "" fcompat } else { @@ -914,13 +907,7 @@ function putent(type, compatwrap) { } if (!rumpable) { - if (funcname == "sys_pipe" && rumphaspipe == 1) { - insysent = 1 - printrumpsysmap(syscall, - funcname, funcalias, "rump_sys_pipe") - } else { - insysent = 0 - } + insysent = 0 } else { insysent = 1 } @@ -1095,27 +1082,6 @@ $2 == "EXTERN" { exit 1 } END { - # output pipe() syscall with its special retval[2] handling - if (rumphaspipe) { - printf("int rump_sys_pipe(int *);\n") > rumpprotos - printf("\nint rump_sys_pipe(int *);\n") > rumpcalls - printf("int\nrump_sys_pipe(int *fd)\n{\n") > rumpcalls - printf("\tregister_t retval[2];\n") > rumpcalls - printf("\tint error = 0;\n") > rumpcalls - printf("\n\terror = rsys_syscall(SYS_pipe, ") > rumpcalls - printf("NULL, 0, retval);\n") > rumpcalls - printf("\tif (error) {\n") > rumpcalls - printf("\t\trsys_seterrno(error);\n") > rumpcalls - printf("\t} else {\n\t\tfd[0] = retval[0];\n") > rumpcalls - printf("\t\tfd[1] = retval[1];\n\t}\n") > rumpcalls - printf("\treturn error ? -1 : 0;\n}\n") > rumpcalls - printf("#ifdef RUMP_KERNEL_IS_LIBC\n") > rumpcalls - printf("__weak_alias(pipe,rump_sys_pipe);\n") > rumpcalls - printf("__weak_alias(_pipe,rump_sys_pipe);\n") > rumpcalls - printf("__strong_alias(_sys_pipe,rump_sys_pipe);\n") > rumpcalls - printf("#endif\n") > rumpcalls - } - # print default rump syscall interfaces for (var in funcseen) { printf("#ifndef RUMP_SYS_RENAME_%s\n", \ diff --git a/sys/kern/sys_descrip.c b/sys/kern/sys_descrip.c index 3f4f822fa12d..0b000df96bac 100644 --- a/sys/kern/sys_descrip.c +++ b/sys/kern/sys_descrip.c @@ -69,6 +69,10 @@ #include __KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.30 2014/09/05 09:20:59 matt Exp $"); +#ifdef _KERNEL_OPT +#include "opt_compat_netbsd.h" +#endif + #include #include #include @@ -761,11 +765,21 @@ sys___posix_fadvise50(struct lwp *l, return 0; } +#ifdef COMPAT_80 int -sys_pipe(struct lwp *l, const void *v, register_t *retval) +compat_80_sys_pipe(struct lwp *l, const void *v, register_t *retval) { - return pipe1(l, retval, 0); + int fd[2], error; + + if ((error = pipe1(l, fd, 0)) != 0) + return error; + + retval[0] = fd[0]; + retval[1] = fd[1]; + + return 0; } +#endif int sys_pipe2(struct lwp *l, const struct sys_pipe2_args *uap, register_t *retval) @@ -776,10 +790,9 @@ sys_pipe2(struct lwp *l, const struct sys_pipe2_args *uap, register_t *retval) } */ int fd[2], error; - if ((error = pipe1(l, retval, SCARG(uap, flags))) != 0) + if ((error = pipe1(l, fd, SCARG(uap, flags))) != 0) return error; - fd[0] = retval[0]; - fd[1] = retval[1]; + if ((error = copyout(fd, SCARG(uap, fildes), sizeof(fd))) != 0) return error; retval[0] = 0; diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 67b574aca9eb..83629129141d 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -245,7 +245,7 @@ pipe_dtor(void *arg, void *obj) * The pipe system call for the DTYPE_PIPE type of pipes */ int -pipe1(struct lwp *l, register_t *retval, int flags) +pipe1(struct lwp *l, int *fildes, int flags) { struct pipe *rpipe, *wpipe; file_t *rf, *wf; @@ -267,33 +267,33 @@ pipe1(struct lwp *l, register_t *retval, int flags) error = fd_allocfile(&rf, &fd); if (error) goto free2; - retval[0] = fd; + fildes[0] = fd; error = fd_allocfile(&wf, &fd); if (error) goto free3; - retval[1] = fd; + fildes[1] = fd; rf->f_flag = FREAD | flags; rf->f_type = DTYPE_PIPE; rf->f_pipe = rpipe; rf->f_ops = &pipeops; - fd_set_exclose(l, (int)retval[0], (flags & O_CLOEXEC) != 0); + fd_set_exclose(l, fildes[0], (flags & O_CLOEXEC) != 0); wf->f_flag = FWRITE | flags; wf->f_type = DTYPE_PIPE; wf->f_pipe = wpipe; wf->f_ops = &pipeops; - fd_set_exclose(l, (int)retval[1], (flags & O_CLOEXEC) != 0); + fd_set_exclose(l, fildes[1], (flags & O_CLOEXEC) != 0); rpipe->pipe_peer = wpipe; wpipe->pipe_peer = rpipe; - fd_affix(p, rf, (int)retval[0]); - fd_affix(p, wf, (int)retval[1]); + fd_affix(p, rf, fildes[0]); + fd_affix(p, wf, fildes[1]); return (0); free3: - fd_abort(p, rf, (int)retval[0]); + fd_abort(p, rf, fildes[0]); free2: pipeclose(wpipe); pipeclose(rpipe); diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 52a6966e9f75..1acd86810989 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -1,14 +1,14 @@ -/* $NetBSD: syscalls.c,v 1.309 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.309 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #if defined(_KERNEL_OPT) #include "opt_modular.h" @@ -69,7 +69,7 @@ const char *const syscallnames[] = { /* 39 */ "getppid", /* 40 */ "compat_43_lstat43", /* 41 */ "dup", - /* 42 */ "pipe", + /* 42 */ "compat_80_pipe", /* 43 */ "getegid", /* 44 */ "profil", /* 45 */ "ktrace", @@ -606,7 +606,7 @@ const char *const altsyscallnames[] = { /* 39 */ NULL, /* getppid */ /* 40 */ NULL, /* compat_43_lstat43 */ /* 41 */ NULL, /* dup */ - /* 42 */ NULL, /* pipe */ + /* 42 */ NULL, /* compat_80_pipe */ /* 43 */ NULL, /* getegid */ /* 44 */ NULL, /* profil */ /* 45 */ NULL, /* ktrace */ diff --git a/sys/kern/syscalls.conf b/sys/kern/syscalls.conf index 227178d0d3e2..a7558c5b49d8 100644 --- a/sys/kern/syscalls.conf +++ b/sys/kern/syscalls.conf @@ -11,7 +11,7 @@ sysalign=1 rumpcalls="../rump/librump/rumpkern/rump_syscalls.c" rumpcallshdr="../rump/include/rump/rump_syscalls.h" rumpsysmap="../rump/rump.sysmap" -compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70" +compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80" libcompatopts="" switchname="sysent" diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 40423d70c88f..d45795820e9a 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -132,7 +132,7 @@ { int|sys||lstat(const char *path, \ struct stat43 *ub); } lstat43 41 STD RUMP { int|sys||dup(int fd); } -42 STD RUMP { int|sys||pipe(void); } +42 COMPAT_80 MODULAR compat { int|sys||pipe(void); } 43 NOERR RUMP { gid_t|sys||getegid(void); } 44 STD { int|sys||profil(char *samples, size_t size, \ u_long offset, u_int scale); } diff --git a/sys/kern/syscalls_autoload.c b/sys/kern/syscalls_autoload.c index c2c0c514fbe1..e310ad519499 100644 --- a/sys/kern/syscalls_autoload.c +++ b/sys/kern/syscalls_autoload.c @@ -1,14 +1,14 @@ -/* $NetBSD: syscalls_autoload.c,v 1.26 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call autoload table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: syscalls_autoload.c,v 1.26 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include static struct sc_autoload netbsd_syscalls_autoload[] = { @@ -21,6 +21,7 @@ static struct sc_autoload netbsd_syscalls_autoload[] = { { SYS_ptrace, "ptrace" }, { SYS_compat_43_stat43, "compat" }, { SYS_compat_43_lstat43, "compat" }, + { SYS_compat_80_pipe, "compat" }, { SYS_compat_13_sigaction13, "compat" }, { SYS_compat_13_sigprocmask13, "compat" }, { SYS_compat_13_sigpending13, "compat" }, diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index 057943476166..4acccdb464bf 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -1,4 +1,4 @@ -/* $NetBSD: systrace_args.c,v 1.28 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call argument to DTrace register array converstion. diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 128189219e98..a87278773ab9 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1265,7 +1265,7 @@ sys_getsockopt(struct lwp *l, const struct sys_getsockopt_args *uap, #ifdef PIPE_SOCKETPAIR int -pipe1(struct lwp *l, register_t *retval, int flags) +pipe1(struct lwp *l, int *fildes, int flags) { file_t *rf, *wf; struct socket *rso, *wso; @@ -1284,7 +1284,7 @@ pipe1(struct lwp *l, register_t *retval, int flags) rso->so_state |= SS_ISAPIPE; if ((error = fd_allocfile(&rf, &fd)) != 0) goto free2; - retval[0] = fd; + fildes[0] = fd; rf->f_flag = FREAD | flags; rf->f_type = DTYPE_SOCKET; rf->f_ops = &socketops; @@ -1295,19 +1295,19 @@ pipe1(struct lwp *l, register_t *retval, int flags) wf->f_type = DTYPE_SOCKET; wf->f_ops = &socketops; wf->f_socket = wso; - retval[1] = fd; + fildes[1] = fd; solock(wso); error = unp_connect2(wso, rso); sounlock(wso); if (error != 0) goto free4; - fd_affix(p, wf, (int)retval[1]); - fd_affix(p, rf, (int)retval[0]); + fd_affix(p, wf, fildes[1]); + fd_affix(p, rf, fildes[0]); return (0); free4: - fd_abort(p, wf, (int)retval[1]); + fd_abort(p, wf, fildes[1]); free3: - fd_abort(p, rf, (int)retval[0]); + fd_abort(p, rf, fildes[0]); free2: (void)soclose(wso); free1: diff --git a/sys/rump/include/rump/rump_syscalls.h b/sys/rump/include/rump/rump_syscalls.h index 528eb22f4621..928b9225c091 100644 --- a/sys/rump/include/rump/rump_syscalls.h +++ b/sys/rump/include/rump/rump_syscalls.h @@ -1,10 +1,10 @@ -/* $NetBSD: rump_syscalls.h,v 1.107 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call protos in rump namespace. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #ifndef _RUMP_RUMP_SYSCALLS_H_ @@ -1058,6 +1058,5 @@ int rump_sys_sendmmsg(int, struct mmsghdr *, unsigned int, unsigned int) __RENAM int rump_sys_clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *) __RENAME(RUMP_SYS_RENAME_CLOCK_NANOSLEEP); int rump_sys_posix_fallocate(int, off_t, off_t) __RENAME(RUMP_SYS_RENAME_POSIX_FALLOCATE); int rump_sys_fdiscard(int, off_t, off_t) __RENAME(RUMP_SYS_RENAME_FDISCARD); -int rump_sys_pipe(int *); #endif /* _RUMP_RUMP_SYSCALLS_H_ */ diff --git a/sys/rump/librump/rumpkern/rump_syscalls.c b/sys/rump/librump/rumpkern/rump_syscalls.c index 409e79cd4e26..b3563e7dd9bb 100644 --- a/sys/rump/librump/rumpkern/rump_syscalls.c +++ b/sys/rump/librump/rumpkern/rump_syscalls.c @@ -1,10 +1,10 @@ -/* $NetBSD: rump_syscalls.c,v 1.136 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call vector and marshalling for rump. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #ifdef RUMP_CLIENT @@ -15,7 +15,7 @@ #ifdef __NetBSD__ #include -__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.136 2017/12/19 19:40:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -6488,28 +6488,6 @@ __weak_alias(_fdiscard,rump___sysimpl_fdiscard); __strong_alias(_sys_fdiscard,rump___sysimpl_fdiscard); #endif /* RUMP_KERNEL_IS_LIBC */ -int rump_sys_pipe(int *); -int -rump_sys_pipe(int *fd) -{ - register_t retval[2]; - int error = 0; - - error = rsys_syscall(SYS_pipe, NULL, 0, retval); - if (error) { - rsys_seterrno(error); - } else { - fd[0] = retval[0]; - fd[1] = retval[1]; - } - return error ? -1 : 0; -} -#ifdef RUMP_KERNEL_IS_LIBC -__weak_alias(pipe,rump_sys_pipe); -__weak_alias(_pipe,rump_sys_pipe); -__strong_alias(_sys_pipe,rump_sys_pipe); -#endif - #ifndef RUMP_CLIENT int rumpns_enosys(void); #define s(type) sizeof(type) @@ -6676,8 +6654,9 @@ struct sysent rump_sysent[] = { .sy_call = (sy_call_t *)rumpns_enosys, }, /* 41 = dup */ { - .sy_call = (sy_call_t *)rumpns_enosys, - }, /* 42 = pipe */ + .sy_flags = SYCALL_NOSYS, + .sy_call = (sy_call_t *)rumpns_sys_nomodule, +}, /* 42 = pipe */ { .sy_call = (sy_call_t *)rumpns_enosys, }, /* 43 = getegid */ diff --git a/sys/rump/librump/rumpkern/rumpkern_syscalls.c b/sys/rump/librump/rumpkern/rumpkern_syscalls.c index 96a15f660e92..bc9f896202c1 100644 --- a/sys/rump/librump/rumpkern/rumpkern_syscalls.c +++ b/sys/rump/librump/rumpkern/rumpkern_syscalls.c @@ -1,9 +1,9 @@ -/* $NetBSD: rumpkern_syscalls.c,v 1.4 2016/01/26 23:12:18 pooka Exp $ */ +/* $NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $ */ /* AUTOMATICALLY GENERATED BY makerumpsyscalls.sh */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpkern_syscalls.c,v 1.4 2016/01/26 23:12:18 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $"); #include @@ -18,7 +18,6 @@ extern sy_call_t sys_getuid_with_euid; extern sy_call_t sys_geteuid; extern sy_call_t sys_getppid; extern sy_call_t sys_dup; -extern sy_call_t sys_pipe; extern sy_call_t sys_getegid; extern sy_call_t sys_getgid_with_egid; extern sy_call_t sys___getlogin; @@ -87,7 +86,6 @@ static const struct rump_onesyscall mysys[] = { { 25, sys_geteuid }, { 39, sys_getppid }, { 41, sys_dup }, - { 42, sys_pipe }, { 43, sys_getegid }, { 47, sys_getgid_with_egid }, { 49, sys___getlogin }, diff --git a/sys/rump/librump/rumpnet/rumpnet_syscalls.c b/sys/rump/librump/rumpnet/rumpnet_syscalls.c index 5f26af923303..88d1d9a547a4 100644 --- a/sys/rump/librump/rumpnet/rumpnet_syscalls.c +++ b/sys/rump/librump/rumpnet/rumpnet_syscalls.c @@ -1,9 +1,9 @@ -/* $NetBSD: rumpnet_syscalls.c,v 1.4 2016/01/26 23:12:18 pooka Exp $ */ +/* $NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $ */ /* AUTOMATICALLY GENERATED BY makerumpsyscalls.sh */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpnet_syscalls.c,v 1.4 2016/01/26 23:12:18 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $"); #include diff --git a/sys/rump/librump/rumpvfs/rumpvfs_syscalls.c b/sys/rump/librump/rumpvfs/rumpvfs_syscalls.c index 4ab1597c337d..c8448a7f9d23 100644 --- a/sys/rump/librump/rumpvfs/rumpvfs_syscalls.c +++ b/sys/rump/librump/rumpvfs/rumpvfs_syscalls.c @@ -1,9 +1,9 @@ -/* $NetBSD: rumpvfs_syscalls.c,v 1.5 2016/01/26 23:12:18 pooka Exp $ */ +/* $NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $ */ /* AUTOMATICALLY GENERATED BY makerumpsyscalls.sh */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpvfs_syscalls.c,v 1.5 2016/01/26 23:12:18 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makerumpsyscalls.sh,v 1.3 2016/01/26 23:24:55 pooka Exp $"); #include diff --git a/sys/rump/rump.sysmap b/sys/rump/rump.sysmap index 1d970413ec3d..0a49b9aa9270 100644 --- a/sys/rump/rump.sysmap +++ b/sys/rump/rump.sysmap @@ -26,7 +26,6 @@ 36 sys_sync sync rump___sysimpl_sync 39 sys_getppid getppid rump___sysimpl_getppid 41 sys_dup dup rump___sysimpl_dup -42 sys_pipe pipe rump_sys_pipe 43 sys_getegid getegid rump___sysimpl_getegid 45 sys_ktrace ktrace rump___sysimpl_ktrace 47 sys_getgid_with_egid getgid rump___sysimpl_getgid diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 2c96313ee01c..3312dd4f1137 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -209,7 +209,7 @@ int fd_dup(file_t *, int, int *, bool); int fd_dup2(file_t *, unsigned, int); int fd_clone(file_t *, unsigned, int, const struct fileops *, void *); void fd_set_exclose(struct lwp *, int, bool); -int pipe1(struct lwp *, register_t *, int); +int pipe1(struct lwp *, int *, int); int dodup(struct lwp *, int, int, int, register_t *); void cwd_sys_init(void); diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index eb0e4f7570cd..f449fa482e31 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -1,10 +1,10 @@ -/* $NetBSD: syscall.h,v 1.303 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #ifndef _SYS_SYSCALL_H_ @@ -136,8 +136,8 @@ /* syscall: "dup" ret: "int" args: "int" */ #define SYS_dup 41 -/* syscall: "pipe" ret: "int" args: */ -#define SYS_pipe 42 +/* syscall: "compat_80_pipe" ret: "int" args: */ +#define SYS_compat_80_pipe 42 /* syscall: "getegid" ret: "gid_t" args: */ #define SYS_getegid 43 diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h index 545279fefd18..eb5579db0373 100644 --- a/sys/sys/syscallargs.h +++ b/sys/sys/syscallargs.h @@ -1,10 +1,10 @@ -/* $NetBSD: syscallargs.h,v 1.287 2017/12/19 19:40:03 kamil Exp $ */ +/* $NetBSD$ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.289 2017/12/19 18:34:47 kamil Exp + * created from NetBSD: syscalls.master,v 1.290 2017/12/19 19:40:03 kamil Exp */ #ifndef _SYS_SYSCALLARGS_H_ @@ -3227,7 +3227,7 @@ int compat_43_sys_lstat(struct lwp *, const struct compat_43_sys_lstat_args *, r int sys_dup(struct lwp *, const struct sys_dup_args *, register_t *); -int sys_pipe(struct lwp *, const void *, register_t *); +int compat_80_sys_pipe(struct lwp *, const void *, register_t *); int sys_getegid(struct lwp *, const void *, register_t *); diff --git a/tests/include/sys/t_socket.c b/tests/include/sys/t_socket.c index 9db224780180..e53f1f9da4ec 100644 --- a/tests/include/sys/t_socket.c +++ b/tests/include/sys/t_socket.c @@ -122,7 +122,7 @@ ATF_TC_BODY(cmsg_sendfd, tc) atf_tc_fail_errno("socket 2 connect"); /* open a pipe and write stuff to it */ - if (rump_sys_pipe(fd) == -1) + if (rump_sys_pipe2(fd, 0) == -1) atf_tc_fail_errno("can't open pipe"); #define MAGICSTRING "duam xnaht" if (rump_sys_write(fd[1], MAGICSTRING, sizeof(MAGICSTRING)) != diff --git a/tests/lib/librumpclient/h_execthr.c b/tests/lib/librumpclient/h_execthr.c index c209375e4b9f..ce2ac91e116b 100644 --- a/tests/lib/librumpclient/h_execthr.c +++ b/tests/lib/librumpclient/h_execthr.c @@ -157,11 +157,11 @@ main(int argc, char *argv[], char *envp[]) SAY("making pipes...\n"); - if (rump_sys_pipe(p1) == -1) + if (rump_sys_pipe2(p1, 0) == -1) err(1, "pipe1"); if (p1[0] != P1_0 || p1[1] != P1_1) errx(1, "p1 assumptions failed %d %d", p1[0], p1[1]); - if (rump_sys_pipe(p2) == -1) + if (rump_sys_pipe2(p2, 0) == -1) err(1, "pipe1"); if (p2[0] != P2_0 || p2[1] != P2_1) errx(1, "p2 assumptions failed"); diff --git a/tests/rump/rumpkern/h_client/h_forkcli.c b/tests/rump/rumpkern/h_client/h_forkcli.c index 3b89727bedd6..99f1b6c3e8cc 100644 --- a/tests/rump/rumpkern/h_client/h_forkcli.c +++ b/tests/rump/rumpkern/h_client/h_forkcli.c @@ -83,7 +83,7 @@ pipecomm(void) int pipetti[2]; int status; - if (rump_sys_pipe(pipetti) == -1) + if (rump_sys_pipe2(pipetti, 0) == -1) errx(1, "pipe"); if ((rf = rumpclient_prefork()) == NULL)