From patchwork Wed Nov 18 19:55:47 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: 41122 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 7395F3948446; Wed, 18 Nov 2020 19:56:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7395F3948446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729397; bh=h71hsFomLH5mRs+abJoI6OM8UWMM6W33h0BrBBI2Ync=; 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=OhliBISKWBvxGkxYA4BEFnXDL4E3NT8opy5AVFA9bAEsxV8ZU5CXGMGwhyg90yfjI awvO1pGh2CTDO/I3Uc4AOLwM5/AfzTzRHDLGFJFUkh04WqC4l+S4++7yUu8J/24C2q AfJB4EqfNI4D8dbxFL4s9ZihWyKphHpxzVKGkHf8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id E9389394742B for ; Wed, 18 Nov 2020 19:56:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E9389394742B Received: by mail-qt1-x836.google.com with SMTP id g17so2610774qts.5 for ; Wed, 18 Nov 2020 11:56:30 -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=h71hsFomLH5mRs+abJoI6OM8UWMM6W33h0BrBBI2Ync=; b=nYBGdNYia6m2vqs7zrUND5cSf6RIr3AI6Iupg37Od8hzHH2nTByJoCZeckRXnB4dw1 BoPAhFasZiZQxLHewDAlQN6wnbj77BLJ9pEGb7mvNkBE9I6AM8Y9i8N0rQi/ZGIRb/n6 +ZphKU6LnAeNLVSMHRdbCjw6/mDaC3TBKXLu4T6yJDuAxJvtVojdPQ1mJobjnxClL/6M fBeY+hAc5A8eeA6gaaW2+WvMC05bzPfX4Kpy5StM4YF9wSDIcKOB7F4rQCioOy6lDG/c MdsNRWacJnMgwRKATh3+NRjZNWpHtHECIeMW6X2TdD+I5PO236pkkm/aF34E6mZ4Bvux x5xg== X-Gm-Message-State: AOAM53120s2kCfjd9FARpFb60ZFZ+aQTDgG+uTAyc/v274Qe009+JoyX 0WDzN5/2rvyko1aDEW2ayQB2lCpgHLPt/Q== X-Google-Smtp-Source: ABdhPJwFOFUUrwSLz4KFzIxJhbGXyQjT5v6GSA/h+fNMI1yltekQvwVNSM1qxt8d/jOwmBC1KN/AHQ== X-Received: by 2002:ac8:3797:: with SMTP id d23mr5912154qtc.205.1605729390301; Wed, 18 Nov 2020 11:56:30 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:29 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 23/28] mips: Implement n32 lseek64 in C Date: Wed, 18 Nov 2020 16:55:47 -0300 Message-Id: <20201118195552.2687336-24-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.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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" Checked on mips64-n32-linux-gnu. --- .../unix/sysv/linux/mips/mips64/n32/lseek64.c | 47 +++++++++++++++++++ .../sysv/linux/mips/mips64/n32/syscalls.list | 5 -- 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c new file mode 100644 index 0000000000..65cec75caf --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c @@ -0,0 +1,47 @@ +/* Linux lseek implementation, 64 bits off_t. MIPS64n32 version. + Copyright (C) 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 +#include + +static inline off64_t +__lseek64_syscall (long int name, int fd, off64_t offset, int whence) +{ + register __syscall_arg_t s0 asm ("$16") = name; + register __syscall_arg_t v0 asm ("$2"); + register __syscall_arg_t a0 asm ("$4") = ARGIFY (fd); + register __syscall_arg_t a1 asm ("$5") = ARGIFY (offset); + register __syscall_arg_t a2 asm ("$6") = ARGIFY (whence); + register __syscall_arg_t a3 asm ("$7"); + asm volatile (".set\tnoreorder\n\t" + MOVE32 "\t%0, %2\n\t" + "syscall\n\t" + ".set reorder" + : "=r" (v0), "=r" (a3) + : "r" (s0), "r" (a0), "r" (a1), "r" (a2) + : __SYSCALL_CLOBBERS); + return a3 != 0 + ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (v0)) + : v0; +} + +#undef INLINE_SYSCALL_CALL +#define INLINE_SYSCALL_CALL(name, ...) \ + __lseek64_syscall(__NR_##name, __VA_ARGS__) + +#include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list deleted file mode 100644 index 6f665635e0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ /dev/null @@ -1,5 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# C syscall macros cannot be used because this syscall has a 64-bit -# return value. -lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28