Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp14060imu; Mon, 19 Nov 2018 16:50:46 -0800 (PST) X-Google-Smtp-Source: AJdET5fPbo5hiGmaaD0At6HSrfyZHmHmh9Qbo+4rZPchjmyIYLo+cKCorriITgpW5rEdQE0IxCg9 X-Received: by 2002:a63:f710:: with SMTP id x16mr22417669pgh.322.1542675046772; Mon, 19 Nov 2018 16:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542675046; cv=none; d=google.com; s=arc-20160816; b=n9uUuJwtIA0cekAATfoHuroSFVJWXy0IHVZj9PXMtTGPUeobpcb4h+ozQpqVwsCIPZ H03lJNtVuQueYjVUN/ctcaqXhchy96Xm3j8TKI4cSC8oVZ+ai5L03mjwBvwAXG3M/u9E H/qRc0R2HChzZlGNu4IrUk8ktrZzIPYMj0zxt09LNXzAMl0h6e9/PIbJxVbMzfRMTAUF rUjm/k2F7RS22uXSzXZyHWR/2bRjt/k2l9v4AoM1HaZkBpOzdY1UNU4G9qiTXmNRZqjB 9r2ZEBdw0eCsLCc9KQoPg206kVPISFoF9D6KNMNj3KFosrloPRy+Daa1TpGTc/qBFmZ0 rqXQ== 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:message-id:subject:cc:to:from:date; bh=nZVZ6YeTbQNuVuBxH57fSz03dj0E9BCovXUCjymRncI=; b=eH+dwzJCCSHHUIbQu37G0Jd/MMsFG3ezQMslhC+Ys8fx4shMwdqamWu9oakRka4m1W c9AP5zvpVkF9KjubnCTSFLT4dH0HzDfMI0q6x4N6CGodiu9Uxwsr5SzbpUlFmXv6ya3O v0m9n1eXwgS+VAg9yu7heoiW+ZeF2RcRdwUUBC5G2CTeCiamOsmCUovdNdbCJSqGkKQG EJMAdOfy+ytpenrDE0w662OvaB5UuKKOuVovlG0fCZS0KcjCcy5XhFGkn4WbfghlxCUu NCVEHYQIZKAGKJlNatCVjLXFhlbuMXQ8k4Ak6uiD3b+JFGtNSiFpBjcdDULY+pDlrMps 4XZQ== 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 e37si535454plb.172.2018.11.19.16.50.26; Mon, 19 Nov 2018 16:50:46 -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 S1732364AbeKTKmg (ORCPT + 99 others); Tue, 20 Nov 2018 05:42:36 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:55546 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbeKTKmg (ORCPT ); Tue, 20 Nov 2018 05:42:36 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 81DE072CA5E; Tue, 20 Nov 2018 03:16:20 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 6EE527CD1FF; Tue, 20 Nov 2018 03:16:20 +0300 (MSK) Date: Tue, 20 Nov 2018 03:16:20 +0300 From: "Dmitry V. Levin" To: Andy Lutomirski , Greentime Hu , Vincent Chen , Paul Moore , Eric Paris Cc: Elvira Khabirova , linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/15] nds32: define syscall_get_arch() Message-ID: <20181120001620.GK11387@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181120001128.GA11300@altlinux.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syscall_get_arch() is required to be implemented on all architectures in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- v2: unchanged since [PATCH 10/13 v2] arch/nds32/include/asm/syscall.h | 8 ++++++++ include/uapi/linux/audit.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/arch/nds32/include/asm/syscall.h b/arch/nds32/include/asm/syscall.h index f7e5e86765fe..569149ca25da 100644 --- a/arch/nds32/include/asm/syscall.h +++ b/arch/nds32/include/asm/syscall.h @@ -5,6 +5,7 @@ #ifndef _ASM_NDS32_SYSCALL_H #define _ASM_NDS32_SYSCALL_H 1 +#include #include struct task_struct; struct pt_regs; @@ -185,4 +186,11 @@ void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, memcpy(®s->uregs[0] + i, args, n * sizeof(args[0])); } + +static inline int syscall_get_arch(void) +{ + return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) + ? AUDIT_ARCH_NDS32BE : AUDIT_ARCH_NDS32; +} + #endif /* _ASM_NDS32_SYSCALL_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 421953fc2f13..b9ce3016e85b 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -400,6 +400,8 @@ enum { #define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\ __AUDIT_ARCH_CONVENTION_MIPS64_N32) +#define AUDIT_ARCH_NDS32 (EM_NDS32|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_NDS32BE (EM_NDS32) #define AUDIT_ARCH_OPENRISC (EM_OPENRISC) #define AUDIT_ARCH_PARISC (EM_PARISC) #define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT) -- ldv