Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6266521imu; Tue, 13 Nov 2018 21:27:59 -0800 (PST) X-Google-Smtp-Source: AJdET5deOeDn8tnK3ikriz7+BfeQBlKVDTZB2xpDOqEuQi1lZMgpgvWN5cJLQOPh3fbS1D+0vM5t X-Received: by 2002:a63:6cc7:: with SMTP id h190-v6mr471366pgc.216.1542173279122; Tue, 13 Nov 2018 21:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542173279; cv=none; d=google.com; s=arc-20160816; b=P03ttUY4A1h673IoZ6UNKvtq/7s+ZgMUyEjpgvc05W500liZssGRjklI2G9r1VihCy GYTZHGf3QoBOaDye2tzz9ZglonZwbLe4udqTboqr+fEiVfQASH7jbZi9Vd6C9vB21XaH UqEBLdcuuiCkgdWxNDn/SeHRYeDhboizgLSTWtJcKMFEizHNAr7BR0tr6fTmqW8DKefR FroNaI3cKwDd89CZRO2QhavG4VfV19uhl1hwH+yMtd1t1Rqo00wSKI54lbyMt063BbXa DDScMLWGgUyk6dPRXmjbgVjU2epxCQLjaj1rWLZct+/1FK2x6LJwPAL0IloNn4P5tv60 N4BQ== 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=B3ds7rWHkGzK5qCHEibhgyG4TVo4EuBJkWgfwHOFgYM=; b=r88tWP8c3xwpExn3qMioCAyvtn6HZGZQ0HzjdoIB7eDLxkR//MIki8+Nx7IXxQ+KmT /f00K2VsVuosM/qEY+u7KKZqqiInnWD3AskuzOUNpbYMIMi+fHa6orPLdTbjeo4uFTCU A3UrJdrcHQRJ557sRmzZFO1wGHuH3KQqrknS6PxDsiXZPF1qjfhBPeARhvkdpydU5AOR LunvRWX1YMz+2SFw094RlmP/jw1Nw6HZ6pqsSbXG7h7Em01FGe2LO39hsaQtEirH8qSo moJwXUTurSCwi95LjUfgWwmSueXLOPLl6wgpI1SBjmSN63mfqRMJLp5UqCQHvz2kxSgY 7yhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E6IlCKgo; 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 s9-v6si25207037pfi.134.2018.11.13.21.27.44; Tue, 13 Nov 2018 21:27:59 -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=E6IlCKgo; 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 S1731619AbeKNP2t (ORCPT + 99 others); Wed, 14 Nov 2018 10:28:49 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36406 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726927AbeKNP2s (ORCPT ); Wed, 14 Nov 2018 10:28:48 -0500 Received: by mail-pl1-f194.google.com with SMTP id w24-v6so7213504plq.3 for ; Tue, 13 Nov 2018 21:27:09 -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=B3ds7rWHkGzK5qCHEibhgyG4TVo4EuBJkWgfwHOFgYM=; b=E6IlCKgoPK9G+itbofuXiUJ7AIRx8lieLRsXMdI9HuxuNZqwPE8tQNwA2zbl/CzE30 PHslebYaHB5DUHKmDIx4mpZ5dEeT3zVVjAbEyP06vtiyDrW7ShSlEZefU19fAezu2yG5 drO21dteT4GmRqxq8vnd+gIWHBjDJJUZbSDZA= 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=B3ds7rWHkGzK5qCHEibhgyG4TVo4EuBJkWgfwHOFgYM=; b=AUs+FLTGNsdvxVlBj9KWM/EIWpHQN33WckmH/VSAmFR78qqckC+vP+Fipqm2m7kbCj aTHII3WtD/uHIrdmezmbv3nGm37GTy0qF2LAo6SUTjVlcEUOClkRdymV/P/hdvSSDA/S 42LPz1CjHLU7I1FMtHTD35sagbkUab6yLB87aLwR0JquH6x3vw2JNvzJFSYM6Yq0d0Dt 21m9KeeCnB3/hmkS30x6sVPbnQhGmwv7t2HoUQcDfbQWmUnmRBxCkBIGR4bVKdTZ0nPJ d2timFoclXWO57nmIelrlIlDm15ldHnGHDtnDIBaINbNpxe+bZAAxttYKSReYVtMCYR2 EKfA== X-Gm-Message-State: AGRZ1gIbdazHuQR9G8ljE/a8MpnAD+1IG3NJTbkN5k08rtYrudW6L3Th gx2So9ZVHnWXkhSBMZhzIATTdw== X-Received: by 2002:a17:902:3084:: with SMTP id v4-v6mr506490plb.326.1542173229004; Tue, 13 Nov 2018 21:27:09 -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 34sm36331746pgp.90.2018.11.13.21.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Nov 2018 21:27:08 -0800 (PST) From: Firoz Khan To: "David S . Miller" , sparclinux@vger.kernel.org, Geert Uytterhoeven , 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 v3 2/4] sparc: add __NR_syscalls along with NR_syscalls Date: Wed, 14 Nov 2018 10:56:29 +0530 Message-Id: <1542173191-24981-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542173191-24981-1-git-send-email-firoz.khan@linaro.org> References: <1542173191-24981-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_syscalls macro holds the number of system call exist in sparc architecture. We have to change the value of NR- _syscalls, 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_sy- scalls value. 1. Update NR_syscalls in asm/unistd.h manually by count- ing the no.of system calls. No need to update NR_sys- calls 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_syscalls 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_syscalls asm/unistd.h. The macro __NR_syscalls 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/sparc/include/asm/unistd.h | 2 ++ arch/sparc/include/uapi/asm/unistd.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 73d2454..5194d86 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -17,6 +17,8 @@ #include +#define NR_syscalls __NR_syscalls + #ifdef __32bit_syscall_numbers__ #else #define __NR_time 231 /* Linux sparc32 */ diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index d37a136..4ae11c4 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h @@ -429,7 +429,9 @@ #define __NR_statx 360 #define __NR_io_pgetevents 361 -#define NR_syscalls 362 +#ifdef __KERNEL__ +#define __NR_syscalls 362 +#endif /* Bitmask values returned from kern_features system call. */ #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 -- 1.9.1