Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3210863imu; Sun, 9 Dec 2018 20:30:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/VbKbEzYAzH6Fp0fMnXtKr9pgvM6jma0QsVs+5czbONO+0YcPnfknETihY447XTPf8LAXgk X-Received: by 2002:a63:5455:: with SMTP id e21mr9723608pgm.316.1544416222682; Sun, 09 Dec 2018 20:30:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544416222; cv=none; d=google.com; s=arc-20160816; b=rfXmIEosg3nS2sbyJ0TWhAp93+wbpE5BvPirTGDNJijYhbd+9nHhVnTfyfiO6yE5+p wJn2aOajKAbaCboFI//orZEFsQa34QyeeN73mv1fBo+9ZN7lx3znJV9jEa5YjsIfNdmx lyx3jqCAhL34aaUDcpdBUuCMp2yc39vunp1PPnR+SnhRxI/chNe11RXRYxZcclAtzkni dGSmpH9IeCb9GB1HU5+OAe/zTbbvBJ6EMdXArM7hS4IxBPC//0Lfnf1Lg+xfYoo/rkVI 4BQV/0+ZxB1mJKfX/S58p1Zz8TNEI5NhkLtTTScNDtWlnafjqEEM4Q6l7CrwidVAkm8J whYQ== 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=u7V9NZys4S21nVrmSbeHmTy5lqmsv2binPdCdgW8pqY=; b=W5Yzo9eJiHXAmn93Isi1uajGgyREeDc8t/7dc9fQck59fvKrdS21T3ZWOXCB7/IPz7 Bu6DXPWU7z0gy1Yff+DdgShLWur+RL6OzGE3Cj/ukM4KtBy1lUXzZFPvQdrX3oAVu0j/ mNtvjwYAlfx366AlN2e14eQqplXxYRch6TNfKS3I6HVQDOnM9h5lm3I8hgafUxt29FAE rWmCkGCzmkQ/Z6+9GbnLwEinVrCVqTbelT4+TEUp8CoMPoqSHdhvCuh5koN3j6p0xjhP 3GR1CN7VMhBuy2TySbSvKxjxoiDqCzUXn8dyTMO+pp6ROY4UfVhw0ciSVAklFwth4X44 tq7g== 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 7si10972603pfb.226.2018.12.09.20.30.07; Sun, 09 Dec 2018 20:30:22 -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 S1726494AbeLJE3Q (ORCPT + 99 others); Sun, 9 Dec 2018 23:29:16 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:38088 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeLJE3P (ORCPT ); Sun, 9 Dec 2018 23:29:15 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 2CDAA72CC66; Mon, 10 Dec 2018 07:29:12 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 242107CEFE9; Mon, 10 Dec 2018 07:29:12 +0300 (MSK) Date: Mon, 10 Dec 2018 07:29:12 +0300 From: "Dmitry V. Levin" To: Mark Salter , Aurelien Jacquiot , Paul Moore , Eric Paris , Oleg Nesterov , Andy Lutomirski Cc: Elvira Khabirova , Eugene Syromyatnikov , linux-c6x-dev@linux-c6x.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH v5 04/25] c6x: define syscall_get_arch() Message-ID: <20181210042912.GD6131@altlinux.org> References: <20181210042352.GA6092@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_arch() is required to be implemented on all architectures in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_error(), and syscall_get_return_value() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Cc: Mark Salter Cc: Aurelien Jacquiot Cc: Paul Moore Cc: Eric Paris Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-c6x-dev@linux-c6x.org Cc: linux-audit@redhat.com Signed-off-by: Dmitry V. Levin --- Notes: v5: added Cc arch/c6x/include/asm/syscall.h | 7 +++++++ include/uapi/linux/audit.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/arch/c6x/include/asm/syscall.h b/arch/c6x/include/asm/syscall.h index ae2be315ee9c..39dbd1ef994c 100644 --- a/arch/c6x/include/asm/syscall.h +++ b/arch/c6x/include/asm/syscall.h @@ -11,6 +11,7 @@ #ifndef __ASM_C6X_SYSCALL_H #define __ASM_C6X_SYSCALL_H +#include #include #include @@ -120,4 +121,10 @@ static inline void syscall_set_arguments(struct task_struct *task, } } +static inline int syscall_get_arch(void) +{ + return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) + ? AUDIT_ARCH_C6XBE : AUDIT_ARCH_C6X; +} + #endif /* __ASM_C6X_SYSCALLS_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index bedf3bf54c3a..72aeea0a740d 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -381,6 +381,8 @@ enum { #define AUDIT_ARCH_ARCV2BE (EM_ARCV2) #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARMEB (EM_ARM) +#define AUDIT_ARCH_C6X (EM_TI_C6000|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_C6XBE (EM_TI_C6000) #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) #define AUDIT_ARCH_FRV (EM_FRV) #define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE) -- ldv