From patchwork Fri Sep 14 08:32:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 146690 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp429462ljw; Fri, 14 Sep 2018 01:33:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZxB9U4B2U3DL4KProfSHwj8sE8ztlm4OiSf4SB+/yIm5z0rXBNFeIxaI+jyqzQbAKZN6AB X-Received: by 2002:a63:91c2:: with SMTP id l185-v6mr10864955pge.321.1536914023202; Fri, 14 Sep 2018 01:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536914023; cv=none; d=google.com; s=arc-20160816; b=cdScckv1NaohwTZDS50oDhwZQV21CN6lCjkO6FoIOF6oq8a2mVTlAChUpnyFztC2zk 527VOEE/YljTsVYT5+pcC9oHCO2/x9VgihEYYtmBmwEmXB6DFYefb0YrtR31xyPPm8hd 0IYd7jSKbj978EhbfWuOTXP7TapY4GhIhxIbhEeMhTFrNfJrICMjsijQ8q8d1i7clc0o JjWpmWk1YoFS2LykYORs3pkQnog743r0XiuIN9J3CHxhAsYmyU7dedzmRhSv86Kyz3N/ FQBojIKxj52ImInApckfaTOKdhRbVj+zKxubPRMI1Px5ArqiI21GLBJ1baP+lN6WHhXE 2TIg== 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=V1pLobhWUOK3+AIkMnLWzrODShe4KPeHpTFV/R+9qIY=; b=BTjIaaUcoNm1NToZrNPetmKos/j3zLq23oGpGtDFTWPrVW/PwwXhix/SBreA+YqgQi fhxjG70y6ErROnVh+sAEXhGM7bAA3cOEUV3sLl2zAnTJhy2xF+cuPw/v8snkFVslQn3f HAODlM2D6C8kGqDBHggiapbXYwE6K6FrAZmoVoqEbqmu7OaVSCRz0M1y2NoVrgsI44NB /22TQUu30Y8a9AVoSfbeAi32sYeqQHkcj7COLuJJsHC4fszVNpKHi+fTX5tOkZK+YqWy +KNA6SkgIfZyMjtguPKdjEPbOxxdS7nkV1V1gS94uRArTqAWEdjULH9Xgz/gBNyLC4AD r2+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I0LxI7IO; 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 o38-v6si3410418pgl.676.2018.09.14.01.33.42; Fri, 14 Sep 2018 01:33:43 -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=I0LxI7IO; 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 S1728270AbeINNrE (ORCPT + 32 others); Fri, 14 Sep 2018 09:47:04 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36583 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbeINNrE (ORCPT ); Fri, 14 Sep 2018 09:47:04 -0400 Received: by mail-pf1-f193.google.com with SMTP id b11-v6so3977403pfo.3 for ; Fri, 14 Sep 2018 01:33:39 -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=V1pLobhWUOK3+AIkMnLWzrODShe4KPeHpTFV/R+9qIY=; b=I0LxI7IOMZWk8Bb6lesmDel8BzNj9snHxgU6ADz3VBp4qmlZgaKfQ3bjErzfzy7mcK owX5QhGfX9gmu5ajCFWyuz1BDVkvgmRFuEFxJiwRaMOn5HCdWRKe9RRAVuL2lwtvDIzc 8CnrGmgXTJnv7FwyyJFJU5utJ0IMCzas5ES7g= 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=V1pLobhWUOK3+AIkMnLWzrODShe4KPeHpTFV/R+9qIY=; b=o0mj1xEaq4kigtFwPVdu4uB+9/g8XGDMpkQIpYtlHAGD93dTn3xEVtYr2dg1XoGzMf B+hy5irrWWljx+G8TZRwSknjQum2lRnN7GKhdqLuAiiEFOq1hD90Zr8sJzjiF6eUndUF h5EVW+zLEm1cNOe1srR3ELR6lJawrPFpBCPyTgT4Ci5B3JzMkL2cZZGVB8LpjXQX+NcF uKceVLoS6lEZQPshWAIyTlEA4X3mNud4mnhTgle7/zOWLAs2/VZtTIwbrZCps6RzCLy8 molkCkYU9vO6sxDJ0NWGFaoBoPgO8hims95J3ZbhB7Noma+FzcUUD3xdIhvGmRlqaM6v 3IDA== X-Gm-Message-State: APzg51DAb452uuvvtPUqWfoYGipr5pQ/gzUOAJz+uIj5Pp00VxoUE3ES TebbwJLWukb5rPT6W8buzWOXhA== X-Received: by 2002:a62:1089:: with SMTP id 9-v6mr11358878pfq.30.1536914019275; Fri, 14 Sep 2018 01:33:39 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.60.83]) by smtp.gmail.com with ESMTPSA id d6-v6sm12427070pgt.66.2018.09.14.01.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Sep 2018 01:33:38 -0700 (PDT) From: Firoz Khan To: Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Ram Pai , Breno Leitao , Boqun Feng , Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH 1/3] powerpc: Replace NR_syscalls macro from asm/unistd.h Date: Fri, 14 Sep 2018 14:02:58 +0530 Message-Id: <1536913980-4811-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536913980-4811-1-git-send-email-firoz.khan@linaro.org> References: <1536913980-4811-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 POWERPC architecture. This macro is currently the part of asm/unistd.h file. 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 number of system call information. So we have two option to update __NR_syscalls value. 1. Update __NR_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR_syscalls untill we either add a new system call or delete an existing system call. 2. We can keep this feature it above mentioned script, that'll count the number of syscalls and keep it in a generated file. In this case we don't need to explicitly update __NR_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I moved the NR_syscalls macro from asm/unistd.h to uapi/asm/unistd.h. The macro name also changed form NR_syscalls to __NR_syscalls 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. Signed-off-by: Firoz Khan --- arch/powerpc/include/asm/unistd.h | 3 +-- arch/powerpc/include/uapi/asm/unistd.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index c19379f..54732f9 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -11,8 +11,7 @@ #include - -#define NR_syscalls 389 +#define NR_syscalls __NR_syscalls #define __NR__exit __NR_exit diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 985534d..f999df2 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h @@ -401,4 +401,6 @@ #define __NR_rseq 387 #define __NR_io_pgetevents 388 +#define __NR_syscalls 389 + #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */