From patchwork Thu Nov 1 13:56:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 149968 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp823609ljp; Thu, 1 Nov 2018 06:57:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5cCt7ViyW2+MJ9rgrFmqs5X8mokDXElCcpER5tvJHiUnU7CarC5agkzROhmBeT1VrELHXwT X-Received: by 2002:a17:902:6bc1:: with SMTP id m1-v6mr7908131plt.34.1541080621957; Thu, 01 Nov 2018 06:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541080621; cv=none; d=google.com; s=arc-20160816; b=KjumxIEgF2/f/+S4z9uSndYj87FPvsT15IW1uD2oR3q2M3WAwxfXwXFuxavi+3RRET ZGyvVVdIfI8FcubWs+jHvgVO9RxdazWIFfJfkuwIaKEaiaA0bSY+ie62IoPviwpwwZHW suSc773cYJs1ZVWx4FbaqcNU03yViYNlBSWTkxZ7XGM1yOVrdhtm5LeHgjsElGg4b9Lb 1LmMF/c2NQ//JcsTRIQxlDnB6uPaye7Fm6h+2A1iRDDx7xennUCuJQmNl0yh36Z4/B7x GIFEB8mD4nqej6AEG8YNkE6wSbPX5g/WZASp0p9W6hkP15ZP3Yp37G+O0be5dFxCT/Je P3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=4qIal7fdLs8KMix5Hy3TLm8h5tkN+4OXLwyC3Lu8zUc=; b=nfIkMzGkCdN1K6++NZjZ2b+glagL779Fn5v6XbsnEh0/b+Jsl/2llR1K6xkMQO9VBj 5r/YV/cw7QkhGths8b08/3ycsLDWFYZFzRppyXpmJf+v/kexAsY2D+uCA+PiCLRVcqBo cp0j3KGSAacfLlfgcn8rk5/dlAxz1mUfhIZajq3MnMs6dmpCgYxFVaFi0yIskEhsgAW3 ShDzns9Nq/ILL7oLCBNr5bFZ+zxZWFkFxwZ5URwhn88HdwI7/FuchnZVvmLslRUvD1kO dC7+H6AKPNMzUj7NvXsa+610vRKBVyrC8zDfRGI7o6YWLjkCn4ZRYupDAMe5m8K3KUkn AwAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fkHJs6jd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63-v6si26199068plb.341.2018.11.01.06.57.01; Thu, 01 Nov 2018 06:57:01 -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; dkim=pass header.i=@linaro.org header.s=google header.b=fkHJs6jd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728923AbeKAXAE (ORCPT + 32 others); Thu, 1 Nov 2018 19:00:04 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34120 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728744AbeKAXAE (ORCPT ); Thu, 1 Nov 2018 19:00:04 -0400 Received: by mail-pg1-f196.google.com with SMTP id k1-v6so7653926pgq.1 for ; Thu, 01 Nov 2018 06:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4qIal7fdLs8KMix5Hy3TLm8h5tkN+4OXLwyC3Lu8zUc=; b=fkHJs6jdDHpZ07dzMy5V+xr1uZsPwoRtbbXFacPdc2ZuxJmSkWw5hXIW1ct/vxpxuO wtaIyAwDEuHYPy0bzYGSnU7cXALzLZjoa14wUJkQDlDBGQwt+JxLkLYYNOym6i4cQyY6 tc6xdGSko2D9RfCx9rOh7aEO19a8FVUU0Y4AU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4qIal7fdLs8KMix5Hy3TLm8h5tkN+4OXLwyC3Lu8zUc=; b=U39zdYrlx1lEYZ5qiMGoi2E2hUMKZH6BzvZy6FEbewW0mj6iXENQgODFoJUqVv5dbO /YKTymukeqLKUiwLNxLQwXkYjGZX7FZVtQxWJLeTG/Tg/yBMbuMRvZvJx22hDsKJiIWA HbHLIqbDfWzKqVS21qc+nm3rjuTMoj8iRRuxqt6yt5avDHJ4OCyEoJPuk7f6Kf4PiK/4 qa3B6dn0GxU84BOFGWwxifdFKlYJiI0UoVYg64EAUUZs3PofDjdxfyW72v4OQWtDjo34 FUFT/OFM1PQfs4KHRYF5/inGkcvSR2aWzm3JtGX+E65OcZh6Rj7ZyA2QRbXeVpEVHQjP evGQ== X-Gm-Message-State: AGRZ1gKSa5o3mjZu/y4nWWC+uCGJxFmfHTb4wnteQ3WPQGKBxCtgA4L6 aDnC0fDg4a4G1pUxvLkLvTvdXw== X-Received: by 2002:a62:1552:: with SMTP id 79-v6mr7743757pfv.120.1541080619511; Thu, 01 Nov 2018 06:56:59 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([106.51.104.211]) by smtp.gmail.com with ESMTPSA id m18-v6sm39076169pfk.149.2018.11.01.06.56.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Nov 2018 06:56:59 -0700 (PDT) From: Firoz Khan To: Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v1 2/4] xtensa: add __NR_syscalls along with __NR_syscall_count Date: Thu, 1 Nov 2018 19:26:19 +0530 Message-Id: <1541080581-4072-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541080581-4072-1-git-send-email-firoz.khan@linaro.org> References: <1541080581-4072-1-git-send-email-firoz.khan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __NR_syscall_count macro holds the number of system call exist in xtensa architecture. We have to change the value of __NR_syscall_count, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update __NR- _syscall_count value. 1. Update __NR_syscall_count in asm/unistd.h manually by counting the no.of system calls. No need to update __NR- _syscall_count until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update __NR_syscall_count in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with __NR_syscall_count asm/unistd.h. The macro __NR_sys- calls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan --- arch/xtensa/include/asm/unistd.h | 2 ++ arch/xtensa/include/uapi/asm/unistd.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index c73eca83..b844081 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h @@ -5,6 +5,8 @@ #define __ARCH_WANT_SYS_CLONE #include +#define __NR_syscall_count __NR_syscalls + #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_LLSEEK diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index c8ac79a..fa26aa2 100644 --- a/arch/xtensa/include/uapi/asm/unistd.h +++ b/arch/xtensa/include/uapi/asm/unistd.h @@ -778,7 +778,9 @@ #define __NR_statx 351 __SYSCALL(351, sys_statx, 5) -#define __NR_syscall_count 352 +#ifdef __KERNEL__ +#define __NR_syscalls 352 +#endif #undef __SYSCALL