From patchwork Fri May 10 15:28:13 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: 10939031 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 C82FB1398 for ; Fri, 10 May 2019 15:28:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6ED528BD3 for ; Fri, 10 May 2019 15:28:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A85D928BDD; Fri, 10 May 2019 15:28:16 +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 1346B28BD3 for ; Fri, 10 May 2019 15:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727346AbfEJP2P (ORCPT ); Fri, 10 May 2019 11:28:15 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:60268 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbfEJP2P (ORCPT ); Fri, 10 May 2019 11:28:15 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 76C5572CCD0; Fri, 10 May 2019 18:28:13 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 4B2F97CCE09; Fri, 10 May 2019 18:28:13 +0300 (MSK) Date: Fri, 10 May 2019 18:28:13 +0300 From: "Dmitry V. Levin" To: Andrew Morton Cc: Helge Deller , "James E.J. Bottomley" , Elvira Khabirova , Eugene Syromyatnikov , Oleg Nesterov , Andy Lutomirski , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v11 4/7] parisc: define syscall_get_error() Message-ID: <20190510152812.GD28558@altlinux.org> References: <20190510152640.GA28529@altlinux.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190510152640.GA28529@altlinux.org> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@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: Helge Deller # parisc Cc: James E.J. Bottomley Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: linux-parisc@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: v11: unchanged v10: unchanged v9: unchanged v8: added Acked-by from https://lore.kernel.org/lkml/1abba4b1-82ef-c23c-c59e-5562dcb5b1bb@gmx.de/ v7: unchanged v6: unchanged v5: initial revision arch/parisc/include/asm/syscall.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/parisc/include/asm/syscall.h b/arch/parisc/include/asm/syscall.h index 80757e43cf2c..00b127a5e09b 100644 --- a/arch/parisc/include/asm/syscall.h +++ b/arch/parisc/include/asm/syscall.h @@ -29,6 +29,13 @@ static inline void syscall_get_arguments(struct task_struct *tsk, args[0] = regs->gr[26]; } +static inline long syscall_get_error(struct task_struct *task, + struct pt_regs *regs) +{ + unsigned long error = regs->gr[28]; + return IS_ERR_VALUE(error) ? error : 0; +} + static inline long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs) {