Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1105797imu; Thu, 13 Dec 2018 09:25:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXmcx+Jmpjj41Nnw0IKA1AtzpV/U5NseHV73GOUTN8FjihywC+pRNT0PhPy5mrzVwnBAqT X-Received: by 2002:a17:902:4827:: with SMTP id s36mr23531034pld.168.1544721928640; Thu, 13 Dec 2018 09:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544721928; cv=none; d=google.com; s=arc-20160816; b=nATYqNkUEOuliwCHyKH9u3jNPOP2sGl/h+E/w8/IVuiQPKAvzPZyYeQITUiFUzEhea nM60WqrR0mb8v/wSHaZvQ50tXoMUBSVhGqV08qnrBBZefGTE80bb++DqpJZja25Xcr5Q 6Augtx57t5GEYjLkOY/YCbSOj971WkV0r8F/oB/fgceaLd+j0P9N19TLmiEyu3kTOCGF EqnTiIKq9qvBbGTmhfWeWpUX+ilMYE84iqIvPeelIsYyAGmlbM3F5acN0OoJ8r5ncUxX 4COeoF0BUSbb9+giFWaRNY2k8l6evUli1XSfqiN8tpq91n0j6t7KAqzpRXKyGsBh/8NC sSdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=85fPv4Ei8aZGlW5na4mewL3dConks7FjPDmMDCJBFZI=; b=NDh05oWTWvUJ0KmLKX3+DnFf1P1t1dO+Ee4fNqnE1HPOzxubQKKmiOUVy0YDCPfR09 SKTYSGUlpIZvTehnLsDGmdwMW53sV/1SmP/Db6I7ZFgOmMuxoZvPKdUyCrg3PjULLUH5 vCMp6DfjxwgPS1Yif7isYQd67ejJB/O23vjg7y67nY+Xr09jQF+GZ/cNDipO1gOR2E/7 K9ky7uMBUJrflEioqR4YB4lmzn05F8A1M1krE89bYOpgdoQAYGVH9l80lyZwaS5SE+xk 33hqN/q0HWrGX5ljD80ujfsG3fhzYa0FaSue1v7QX8me4vM+7K49fgnuFbdRx9F9ve7G tQrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si1988418pgn.390.2018.12.13.09.25.13; Thu, 13 Dec 2018 09:25:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729852AbeLMRXG (ORCPT + 99 others); Thu, 13 Dec 2018 12:23:06 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:39034 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbeLMRXF (ORCPT ); Thu, 13 Dec 2018 12:23:05 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id CEB0372CC6C; Thu, 13 Dec 2018 20:23:02 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id B44C2964E82; Thu, 13 Dec 2018 20:23:02 +0300 (MSK) Date: Thu, 13 Dec 2018 20:23:02 +0300 From: "Dmitry V. Levin" To: Paul Burton , Ralf Baechle , James Hogan , Oleg Nesterov , Andy Lutomirski Cc: Elvira Khabirova , Eugene Syromyatnikov , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 16/27] mips: define syscall_get_error() Message-ID: <20181213172302.GP6024@altlinux.org> References: <20181213171833.GA5240@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cc: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-mips@vger.kernel.org Signed-off-by: Dmitry V. Levin --- Notes: 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 6cf8ffb5367e..04ab927ff47d 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) { -- ldv