From patchwork Wed Nov 18 19:55:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41123 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 203583948827; Wed, 18 Nov 2020 19:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 203583948827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729398; bh=LAmCIwVJjt1mq6/5hOQQztmVoSA505wgt3FG+/GYPus=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KdOttoYGEaOT7nxZR1a9qxtQSCFG1FWd2ORGbVPSCzkMB+gZVTWCP8bpEVsYdotV5 jNJC8XpVZxjtfyeg927qypyscej7+n1bq5OW8UhVfRfOWqsVpyAqMHJhYgJ7rk2VT6 xvxM6r3OieQfeWreorzK5bBy5o8FWyKTfW2v0/PY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 175E33948024 for ; Wed, 18 Nov 2020 19:56:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 175E33948024 Received: by mail-qv1-xf30.google.com with SMTP id ec16so1693979qvb.0 for ; Wed, 18 Nov 2020 11:56:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LAmCIwVJjt1mq6/5hOQQztmVoSA505wgt3FG+/GYPus=; b=XXtPnymcVvcWImX7+rbyMINLwror82LbAJIeuyv8ONYiDn36r23IB13UzpXRRr+b6V Y7tvUEJ3GSzmO1sjEPBYm5hhPEszkyyFYbbiRRq42nZLBnhipE1ewWk/+wKr1TLkoEBp FfZt6KnnDB0b7aGt+VyvM+uWO9PShzUcf3c0Rqntt9kEE4kSth021CPbcbZscxzn7oop 5f7pLJMINvl4KfvjgI9FdfGsDzslEWzarzHjPPlJsbCwheGyeoxyBr4M+zFXRUjKwOIW TFawCHt63wzciEOhJ0i+THsCs6f1jUyh1BVXru02I7Dgmq1hQ4AIdyteLnVoDft7L/mF ffcg== X-Gm-Message-State: AOAM532y/UbLvucj8t0PFionHVIVx/hrkeEa7t/yC1LfT7jFRbih5vMq HSlKhcjOY3owKKDDi+UYcPhqeCLV8f6Pfg== X-Google-Smtp-Source: ABdhPJxVHVbPZ+T3susl77vrd6vgCmZBMfuiUlkYLMyGX711sLpKVwEHhG0GMK87ZpmS6t87SJkJUA== X-Received: by 2002:a0c:a544:: with SMTP id y62mr6578365qvy.11.1605729393152; Wed, 18 Nov 2020 11:56:33 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:32 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 25/28] linux: Implement pipe in terms of __NR_pipe2 Date: Wed, 18 Nov 2020 16:55:49 -0300 Message-Id: <20201118195552.2687336-26-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It removes the arch-specific implementation for alpha, ia64, mips, sh, and sparc which requires a different kernel ABI than the usual one. Checked on x86_64-linux-gnu and with a build for the affected ABIs. --- sysdeps/unix/alpha/pipe.S | 31 --------------- sysdeps/unix/mips/pipe.S | 32 --------------- sysdeps/unix/sysv/linux/alpha/pipe.S | 1 - sysdeps/unix/sysv/linux/ia64/pipe.S | 37 ----------------- sysdeps/unix/sysv/linux/mips/pipe.S | 1 - sysdeps/unix/sysv/linux/{generic => }/pipe.c | 6 +-- sysdeps/unix/sysv/linux/sh/pipe.S | 42 -------------------- sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S | 39 ------------------ sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S | 40 ------------------- sysdeps/unix/sysv/linux/syscalls.list | 1 - 10 files changed, 3 insertions(+), 227 deletions(-) delete mode 100644 sysdeps/unix/alpha/pipe.S delete mode 100644 sysdeps/unix/mips/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/alpha/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/ia64/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/mips/pipe.S rename sysdeps/unix/sysv/linux/{generic => }/pipe.c (86%) delete mode 100644 sysdeps/unix/sysv/linux/sh/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S diff --git a/sysdeps/unix/alpha/pipe.S b/sysdeps/unix/alpha/pipe.S deleted file mode 100644 index ae2d94b061..0000000000 --- a/sysdeps/unix/alpha/pipe.S +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1993-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger (davidm@cs.arizona.edu). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* __pipe is a special syscall since it returns two values. */ - -#include - -PSEUDO (__pipe, pipe, 0) - stl r0, 0(a0) - stl r1, 4(a0) - mov zero, v0 - ret -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S deleted file mode 100644 index d541c138c1..0000000000 --- a/sysdeps/unix/mips/pipe.S +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -SYSCALL__ (pipe, 1) - /* Plop in the two descriptors. */ - sw v0, 0(a0) - sw v1, 4(a0) - - /* Go out with a clean status. */ - move v0, zero - j ra -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/alpha/pipe.S b/sysdeps/unix/sysv/linux/alpha/pipe.S deleted file mode 100644 index 1e7ec1c199..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/ia64/pipe.S b/sysdeps/unix/sysv/linux/ia64/pipe.S deleted file mode 100644 index c5b8189a28..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/pipe.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* __pipe is a special syscall since it returns two values. */ - -#include - -ENTRY(__pipe) - .regstk 1,0,0,0 - DO_CALL (SYS_ify (pipe)) - cmp.ne p6,p0=-1,r10 - ;; -(p6) st4 [in0]=r8,4 -(p6) mov ret0=0 - ;; -(p6) st4 [in0]=r9 -(p6) ret - br.cond.spnt.few __syscall_error -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/mips/pipe.S b/sysdeps/unix/sysv/linux/mips/pipe.S deleted file mode 100644 index 1708888da4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/generic/pipe.c b/sysdeps/unix/sysv/linux/pipe.c similarity index 86% rename from sysdeps/unix/sysv/linux/generic/pipe.c rename to sysdeps/unix/sysv/linux/pipe.c index 52f3231cb8..0ea6ca5842 100644 --- a/sysdeps/unix/sysv/linux/generic/pipe.c +++ b/sysdeps/unix/sysv/linux/pipe.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2020 Free Software Foundation, Inc. +/* Create create pipe. Linux generic version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,7 @@ int __pipe (int __pipedes[2]) { - return INLINE_SYSCALL (pipe2, 2, __pipedes, 0); + return INLINE_SYSCALL_CALL (pipe2, __pipedes, 0); } libc_hidden_def (__pipe) weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sh/pipe.S b/sysdeps/unix/sysv/linux/sh/pipe.S deleted file mode 100644 index 0e7a5a4ded..0000000000 --- a/sysdeps/unix/sysv/linux/sh/pipe.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -ENTRY (__libc_pipe) - mov #+__NR_pipe, r3 - trapa #0x10 - mov r0, r3 - mov #-12, r2 - shad r2, r3 - not r3, r3 // r1=0 means r0 = -1 to -4095 - tst r3, r3 // i.e. error in linux - bt 1f - mov.l r0, @r4 - mov.l r1, @(4, r4) - rts - mov #0, r0 -1: - SYSCALL_ERROR_HANDLER -.Lpseudo_end: - rts - nop -PSEUDO_END (__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S deleted file mode 100644 index 0b10f1522b..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Miguel de Icaza , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - - .text - .globl __syscall_error -ENTRY(__libc_pipe) - mov %o0, %o2 /* Save PIPEDES. */ - mov SYS_ify(pipe),%g1 - ta 0x10 - bcc 1f - mov %o7, %g1 - call __syscall_error - mov %g1, %o7 -1: st %o0, [%o2] /* PIPEDES[0] = %o0; */ - st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ - retl - clr %o0 -END(__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S deleted file mode 100644 index 072a1936ea..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Miguel de Icaza , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - - .text - - .globl __syscall_error -ENTRY(__libc_pipe) - mov %o0, %o2 /* Save PIPEDES. */ - LOADSYSCALL(pipe) - ta 0x6d - bcc,pt %xcc, 1f - mov %o7, %g1 - call __syscall_error - mov %g1, %o7 -1: st %o0, [%o2] /* PIPEDES[0] = %o0; */ - st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ - retl - clr %o0 -END(__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 7a0172a422..483caca465 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -38,7 +38,6 @@ mount EXTRA mount i:sssUp __mount mount munlock - munlock i:aU munlock munlockall - munlockall i: munlockall nfsservctl EXTRA nfsservctl i:ipp __compat_nfsservctl nfsservctl@GLIBC_2.0:GLIBC_2.28 -pipe - pipe i:f __pipe pipe pipe2 - pipe2 i:fi __pipe2 pipe2 pivot_root EXTRA pivot_root i:ss pivot_root query_module EXTRA query_module i:sipip __compat_query_module query_module@GLIBC_2.0:GLIBC_2.23