From patchwork Tue Nov 13 10:19:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 150959 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4218500ljp; Tue, 13 Nov 2018 02:20:05 -0800 (PST) X-Google-Smtp-Source: AJdET5cUSRWdgYuchhYx3ZMyJ04ud7tCS+4dUL6DAD7MLf/Q7MHtrdpdiykfQGPqHWawoggydnSG X-Received: by 2002:a63:6045:: with SMTP id u66mr4253826pgb.204.1542104405332; Tue, 13 Nov 2018 02:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542104405; cv=none; d=google.com; s=arc-20160816; b=UQ6S0eHM/rTSH3V/OIFvzduedsBjEpcBQ/QZQ4liaiy+atbmY897WHxTOnvZ/NWEdj 1CIVNUxVDG6fJqtpPzAzIwgYqvQ0tKL/8gEY19vfxzNBij4/fv6HbNaxWQHMga1Hrv4I dmfdEMr0IQVqSkpzdErJjoB/MRMeY/6DOpwA5OziIzglkTmrc4WqpdX7x+0SQM6eIn83 KtjM1+4L5B3Mveljbxnlpuhk69A60FIqHez0GNNkKpq0AGbVNvHbgKAP54piuzL8odaL sWOHrQ+0ywq/2/GQVLx6MrCX7UWK/ncraz2qbgnYWXzXKFTWiXRYz2DbzhkVFI+cdMHX kZZQ== 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=iAxfK6mJJTXjojV0s0X/f7oWUHPo/2/Qtwcy0lQmsO0=; b=Rlq5lAb4nHkPYjCdSTfl2CGhwf5rxcn1GdXe+oBhzziMJJA0rNINMovRdwHSpYxF+X +dTxvv9ywSei3j6M6UK64ILtCzGRm6TsuE0NBAUjOqrrj9U2NnSG1ybXGCSM/4paVS01 VV30F6v8mvD3ZFKbIELR9u9QObhADvtJuMprAGrmGRfVLPnUvjJnYoNkRlhAbY7yKhnF ZQyQpngWO7m2WCxUZ1nxLe2aJ3fCLWnPm9jKTjkC0su0TwjH9FJY4TA4sihLrnTL+tQn p9pOH8GPuVGH6agH+2RcJ7j0ob+HD/96ad9sYu2LLLwPGDSzqZ8kHmpKGSMa4ZRFsZdH LR2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="V/TOESN1"; 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 b6-v6si13480221plr.386.2018.11.13.02.20.04; Tue, 13 Nov 2018 02:20:05 -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; dkim=pass header.i=@linaro.org header.s=google header.b="V/TOESN1"; 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 S1732142AbeKMUR2 (ORCPT + 32 others); Tue, 13 Nov 2018 15:17:28 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39092 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbeKMUR1 (ORCPT ); Tue, 13 Nov 2018 15:17:27 -0500 Received: by mail-pg1-f194.google.com with SMTP id r9-v6so5478355pgv.6 for ; Tue, 13 Nov 2018 02:20:02 -0800 (PST) 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=iAxfK6mJJTXjojV0s0X/f7oWUHPo/2/Qtwcy0lQmsO0=; b=V/TOESN1rmhipP+yrrPcnozAiqFifBxqXhwr4OG9wTSAcSyX5MO9az/FEMpScsxpHk Q+UBrjw6lFJALPjXn2HyvDXFtQCKi1JKJuw8fCiLY9h7mrr9fUcS0lWXQTiNB/gxh156 JRObWrA7luxjKm2zaX1iJY2SeWSiUe6fDLJDc= 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=iAxfK6mJJTXjojV0s0X/f7oWUHPo/2/Qtwcy0lQmsO0=; b=pyqiqL4DQoNBkT5+AMbMf5Vu7Xs9ND/BC5MkEl9FStcZBnLgiSswCaC59i7uqbGwnZ RKIzCWTF3cIzyY0gzZYXwkijJjHFiBEDMSaHwBov/pApqtk0nUDUQEFvFutfCWjIwUqM BB65LRzefYBeTJ5iqyjG6N9NgEtK2RxDVKZr3VXsxXgpA5UbUu+ycDPypjLkVeY9Blyn tf4XTeTFbjLN50lo4VA5rgk2GH9I9Z3/8nMRwMN+9d1GEAkqLS3RP4AqEMtfEZX+hOQB 02RT9Iiaf5G8n6A0aSHjkWSvL45bYbqHVFZAkBLmoRIdfdbPXQZ/RErAue2ZKKGP5ati AGYg== X-Gm-Message-State: AGRZ1gL7k+zXN+NotqoVUpu+RMUkx+yjw0KB8YuUZB9lM0GPKkZDNYZs NJUkdZF9ffdgzitewnp/hTrnrg== X-Received: by 2002:a62:fb14:: with SMTP id x20-v6mr4494432pfm.71.1542104402055; Tue, 13 Nov 2018 02:20:02 -0800 (PST) Received: from qualcomm-HP-ZBook-14-G2.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id f10-v6sm13363364pfa.188.2018.11.13.02.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Nov 2018 02:20:01 -0800 (PST) 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 v2 1/3] xtensa: add __NR_syscalls along with __NR_syscall_count Date: Tue, 13 Nov 2018 15:49:28 +0530 Message-Id: <1542104370-22831-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542104370-22831-1-git-send-email-firoz.khan@linaro.org> References: <1542104370-22831-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 574e552..787987a 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_NEW_STAT #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_UTIME diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index bc3f62d..332d67a 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 /* * sysxtensa syscall handler