From patchwork Mon Apr 8 17:41:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 10889941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2176313B5 for ; Mon, 8 Apr 2019 17:41:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07C7C287C3 for ; Mon, 8 Apr 2019 17:41:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F01B1287D1; Mon, 8 Apr 2019 17:41:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65EA0287C3 for ; Mon, 8 Apr 2019 17:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbfDHRl5 (ORCPT ); Mon, 8 Apr 2019 13:41:57 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:32894 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbfDHRl4 (ORCPT ); Mon, 8 Apr 2019 13:41:56 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id BCD4172CCAC; Mon, 8 Apr 2019 20:41:53 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 273C37CCE4F; Mon, 8 Apr 2019 20:41:52 +0300 (MSK) Date: Mon, 8 Apr 2019 20:41:52 +0300 From: "Dmitry V. Levin" To: linux-kernel@vger.kernel.org Cc: Stephen Rothwell , Paul Burton , Elvira Khabirova , Eugene Syromyatnikov , Ralf Baechle , James Hogan , Oleg Nesterov , Andy Lutomirski , linux-mips@vger.kernel.org Subject: [PATCH linux-next v9 3/7] mips: define syscall_get_error() Message-ID: <20190408174152.GD11889@altlinux.org> References: <20190408174036.GA11889@altlinux.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190408174036.GA11889@altlinux.org> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP syscall_get_error() is required to be implemented on all architectures in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_return_value(), and syscall_get_arch() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Acked-by: Paul Burton Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Ralf Baechle Cc: James Hogan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-mips@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v9: unchanged v8: unchanged v7: added Acked-by v6: unchanged v5: initial revision arch/mips/include/asm/syscall.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index acf80ae0a430..83bb439597d8 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h @@ -89,6 +89,12 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, unreachable(); } +static inline long syscall_get_error(struct task_struct *task, + struct pt_regs *regs) +{ + return regs->regs[7] ? -regs->regs[2] : 0; +} + static inline long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs) {