From patchwork Tue Nov 13 06:57:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 150932 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4056930ljp; Mon, 12 Nov 2018 22:58:28 -0800 (PST) X-Google-Smtp-Source: AJdET5cuRr0WrQ7JGwJ4PmCHOaueLaRdFoRd1GXOOSbNASENIE3DTBp4+2s9FI8COuJQ5cP9Yvbt X-Received: by 2002:a62:3687:: with SMTP id d129-v6mr4008247pfa.56.1542092308326; Mon, 12 Nov 2018 22:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542092308; cv=none; d=google.com; s=arc-20160816; b=Exwu+Y3EYIoG7Dayix5gG2MJ329DQ4ezjejIAxIqYeW7AFcFCgG5iaArQOX70oMwBI 0fuuzcyWHkoQTtJXRvgUR57airiEaABx+9t6GiLOqzXmZjXMBELlPHecLcAQLB2faIX6 VZJ+b0YEk4jbrDZ4k22RrTLI+n/ZiowXFpbtUvOKj317tTSEu0t3IdsGJTrJPkteyazc gJLAWziPpm4EXBqFBYk6Jr3jsNoPfocJBd5wDE36Kvz0JIyc2lQQOxDwSlA2RPVYN94v MdHPnFwgsScgQOkgeW6KdnoSG5oeX2hksLRFrnknE8ryr9L2Cunsa9ov+Jl0ChTUtvPC WskA== 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=yNIl1XiLhRzKxCPbqGLZO4Ur4FhlYlJ4hj8ePU/zaS0=; b=H1a3ybO6CnwXWGWtQiPKAkFFCD0sB8P5Ev050IJpdIg73UAeBIA4xahL1K52BTvHbY wz7QNyweuRLX0SH6Klr7gUgIBVTFaI+kzgPTSS17moU5gBdCNy6cZirWqr/sCazEJ9KM frwEXGfs5P9SYXVmQrYoivYoHgKaKaE/3y28wB2e7b8tu0qC5aSc1gpuRP8ojIownEwv U2dzz81XEpuOJsFN6Uob61dodWH8cQKxRiqALhrYzeDzkB4AZuXvDvrSbJkB0lkmzKNl aLG7W5e5vpuvVlaNc/4YViELCmS8tTzHFTM4jnjtHI1ofqMKNjuxPAEIAwg20k3WuVz3 KpoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ijZEeocL; 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 p10si18447252pgi.549.2018.11.12.22.58.28; Mon, 12 Nov 2018 22:58:28 -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=ijZEeocL; 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 S1731151AbeKMQzG (ORCPT + 32 others); Tue, 13 Nov 2018 11:55:06 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42604 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731059AbeKMQzG (ORCPT ); Tue, 13 Nov 2018 11:55:06 -0500 Received: by mail-pf1-f193.google.com with SMTP id 64so1088194pfr.9 for ; Mon, 12 Nov 2018 22:58:23 -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=yNIl1XiLhRzKxCPbqGLZO4Ur4FhlYlJ4hj8ePU/zaS0=; b=ijZEeocLfZ0Tl1dWX3cc6NfwUPQ23N9SskfDTqjsInrXFi4EGZUAmumhHzw1ZQzyVW xTmMBGslo5/5OD2pBvM4QKu5sJOkGfiy236XKIk7F4hbDcCrIvDLT4jOzhih1wlUHus2 DLGoevKQ3VnIDRgOTc/xxxkmF1EgQ/LWSONyg= 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=yNIl1XiLhRzKxCPbqGLZO4Ur4FhlYlJ4hj8ePU/zaS0=; b=eCREZCbBfl5kitwKIYNrfbUa5u5t4fhOAF6z10b114Hcz+A55K1b22rfMmlptXISKn n1K/32l20wmZFwmCfEuLj/PZaKq1TsIR7AaOXCCshiAhkR8Iuu0r5OG9XmPbKy7SmSFd oP0kvWLolBf7IzL0a7ea7IemC+cz26N5NBF8GPjIV60hwkfuHj1Vhp75NXOE/alja5MW m+a5qaayuVxf2j0TuhKOEdjbGUdV62L2dR6QO0OMAIlr3USgLd7n0D1btZxkZSt6H97S sffpAk2ipnK8XHnR+5aJUFP2foEHvRV1+UPTHoPRSxVvIcnvfDK8AZcxGWpipjiHr0xA US0A== X-Gm-Message-State: AGRZ1gIvjGvRvNAPzzp7xCpVdo6kdTQU8oPOept34UnX2dUA3sJSyPqs jQtMckculkdQHmDWNhZu7iJpcg== X-Received: by 2002:a63:8c2:: with SMTP id 185mr3703168pgi.26.1542092303061; Mon, 12 Nov 2018 22:58:23 -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 s186-v6sm42437935pfs.164.2018.11.12.22.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 22:58:22 -0800 (PST) From: Firoz Khan To: linux-ia64@vger.kernel.org, Tony Luck , Fenghua Yu , Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , 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 v5 2/5] ia64: add __NR_syscalls along with NR_syscalls Date: Tue, 13 Nov 2018 12:27:42 +0530 Message-Id: <1542092265-20956-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542092265-20956-1-git-send-email-firoz.khan@linaro.org> References: <1542092265-20956-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 ia64 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/ia64/include/asm/unistd.h | 4 +--- arch/ia64/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 49e34db..0b08ebd 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -10,9 +10,7 @@ #include - - -#define NR_syscalls 326 /* length of syscall table */ +#define NR_syscalls __NR_syscalls /* length of syscall table */ /* * The following defines stop scripts/checksyscalls.sh from complaining about diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 94b835c..388ab4e 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -341,4 +341,8 @@ #define __NR_preadv2 1348 #define __NR_pwritev2 1349 +#ifdef __KERNEL__ +#define __NR_syscalls 326 +#endif + #endif /* _UAPI_ASM_IA64_UNISTD_H */