From patchwork Wed Nov 14 05:26:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 151024 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5274662ljp; Tue, 13 Nov 2018 21:27:12 -0800 (PST) X-Google-Smtp-Source: AJdET5d3gcKkVV4kXy9cVv9txjjGGhWe1oYJ8OBdQEkEcp7iRTRPHEsK0ZXYbqHrjFV2yQxbvT8p X-Received: by 2002:a63:fb46:: with SMTP id w6mr449786pgj.321.1542173232113; Tue, 13 Nov 2018 21:27:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542173232; cv=none; d=google.com; s=arc-20160816; b=irAzINYu/VhzrV1e9+WtoM0C6kimx695KfXOw+K9OeGYznJf5IOfLoUseUsayHUyBZ rfWjkyXhtryxCAfZlogPsLIgcrcdlX/slOqeHPd4FaiOW0S0Fx+9SPNoPOk+NDHByr8W Z37gWeToyzCccPg5E95vcrmgXiL+E0Bb1q/IGY6/oo9HlzNNBUlrKY+X0eYLK7RecEkZ aOi9mNLdDQ1vuOVtW+6w0l0YAuq/v1yeLXA8yS0/McZpTLYozZEcLHbbK6GvcpPCG74I tQ0REpK+a2JDy8zgMaxGbgLqDMAf2GaJj7x+HA4NzwWBGTPb4REKgcIrYj6PhsQyP4vd Fngw== 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 f6-v6si23030294plr.115.2018.11.13.21.27.11; Tue, 13 Nov 2018 21:27:12 -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 S1731645AbeKNP2t (ORCPT + 32 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(-) -- 1.9.1 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