Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2282798yba; Fri, 10 May 2019 09:01:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcrxRjRub7pOpSwEAl7lq591TvEI4LqljppRm2iVHTj/txQumITIaVp0Hx+6PEfAGvVVeO X-Received: by 2002:a65:5687:: with SMTP id v7mr14686605pgs.299.1557504091841; Fri, 10 May 2019 09:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557504091; cv=none; d=google.com; s=arc-20160816; b=zIMgnVWeSXr8bmfSOmP/yBCyMzDW7N5e4G7+SOCRrcgMJm1pWO/V4WSnzqNpeAuYC3 nXcJ/oLteNolg6D+b9HsPBAQkHbwQL9SHN68rBJBqZEiwrqxmtdD+AT78zAVsj4wcW9b iJhMOPe/qj7461aAZWYx9+Wn33JPCuCnsDHsZIc1PIuHu+zvc2WKQGbg0vNs7ee6hkrz oOUGcxKIojJsTBAtxwFFv8h2RV3f8v9HS/r53DUk/ycwCT8qLF0HlCtO+DH+dbqWVEro rmg5PtD+Q1n6vSWfuTQx79G9bZnDuZMX6zrtzoomJylrIFDqJ0ncWFfzqgqg8PX5H8ab +xog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rTFDWtVNiUnltAQxaUDnpibpgog2iwzCR70Db0iPAlc=; b=TwsV1AHgdPtn3rHPfMQ4ByjRES7A82oXIHoDKIyWFz4NOt66QOBb0wLyYfW9o3VrRf aBfx0xSZEx2MmIo8P1HlFGMEMZmrWgH/uzYRrzp/f1SihVQu5yXjaBe70Mid9vL8YbDx dz28k2ypfBuVs5s/7IbnNJJnpSwDNTFwIoVR9ETT62gyx8lPJ+G3YWNqMU6Aik3WNicq jbwNSkzzJwYoEWbLWlXDCBkRnlZqwdlQrjgGppV9nZ4jIS/4zR53h29/HUOX0nTMN7Fq jPva0XdWpllSF6rhJC4udjU1csDD1gzg85Em3w/l4WzaqkWqoVm1PDBrQ1rM5B1t/Fm8 uJnA== 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 74si7212862pgb.203.2019.05.10.09.01.14; Fri, 10 May 2019 09:01:31 -0700 (PDT) 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 S1727725AbfEJP2G (ORCPT + 99 others); Fri, 10 May 2019 11:28:06 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:60108 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbfEJP2F (ORCPT ); Fri, 10 May 2019 11:28:05 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 6BB4872CCD3; Fri, 10 May 2019 18:28:03 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 5AEC97CCE09; Fri, 10 May 2019 18:28:03 +0300 (MSK) Date: Fri, 10 May 2019 18:28:03 +0300 From: "Dmitry V. Levin" To: Andrew Morton Cc: Paul Burton , Elvira Khabirova , Eugene Syromyatnikov , Ralf Baechle , James Hogan , Oleg Nesterov , Andy Lutomirski , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v11 3/7] mips: define syscall_get_error() Message-ID: <20190510152803.GC28558@altlinux.org> References: <20190510152640.GA28529@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510152640.GA28529@altlinux.org> 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. 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: v11: unchanged v10: unchanged v9: unchanged v8: unchanged v7: added Acked-by from https://lore.kernel.org/lkml/20181213190015.olf6vhuimjl4jixs@pburton-laptop/ 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) { -- ldv