From patchwork Tue Nov 13 06:00:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 150921 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4013155ljp; Mon, 12 Nov 2018 22:01:12 -0800 (PST) X-Google-Smtp-Source: AJdET5daS2SPNkSfgafBWZ7hNdrltNDl7CX9rTLLjjz08ExQK4v3ThnyhFBnxPvMcQAAAPJxc+17 X-Received: by 2002:a62:5904:: with SMTP id n4mr3805899pfb.120.1542088872770; Mon, 12 Nov 2018 22:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542088872; cv=none; d=google.com; s=arc-20160816; b=dJflrdTeJ2sqbUoihlqkGgn7xPBI7BST1VUz8a4/P21X3KxNssEOzWQCKsiTj7Trkr xMB14uHh+Yj0X+jkiDEe9/QxesUqfte4+giTexXQ3JA5loSQ0hCoTVr9Vv12f02Ikt0Q /xJaAxEm1gFTki5OxAguwhiFRUpjFnJ36ipPJkIhEuES9KUbRoEG8ZhUzAR2ZiNlO3sp qjbYEjVVnspypPg4QSczDcYqKGgc9imMEFVv33ccxAKnkaS3aWetT1FU89TpzC3msixn QbvPfEnM339fuicGYqCW1tOmv2IxnNO7+9+u6FgU5N3rSOgHj4/RgFrfspPLMECPVtlk lRog== 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=L1MmGLhowMkEp3+3jZ4blj4L16FJ2J4LnmdalTZsoAw=; b=JAgK9ME5b26a65DPJ3i+QDrurbl3URc22t3nlg4osJTTf1lncQ68w4nxNY+M2uyt+6 KNF7qcTDacdKj/Y54Wa0nAYHvkjild47tap5c+E8ItN9UG7SZnBWpnDMb7kz0hHWzYyI oPJOyFwLyxmswheaEacbSw4zIq8/4ZO0ruNLN7N8GZQkRw7MvebInHObdlj0VgPuNfrx TpFq++Ppv6Av0UrlP3E5XVEY6qUfcZQhH0d04Q/j9woX5iXDp4SCH8KXqGX/guMmFVaI khvQfBgapps0GzCnyVjcaoGnjCDtTJjRNDBDjkTAAbQoZIEAayyPElqJE2DRqpKwcb3c DYYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fT8ABgGg; 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 h128si1231646pfe.204.2018.11.12.22.01.12; Mon, 12 Nov 2018 22:01: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=fT8ABgGg; 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 S1732386AbeKMP5k (ORCPT + 32 others); Tue, 13 Nov 2018 10:57:40 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:32897 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731956AbeKMP5j (ORCPT ); Tue, 13 Nov 2018 10:57:39 -0500 Received: by mail-pg1-f194.google.com with SMTP id z11so2543802pgu.0 for ; Mon, 12 Nov 2018 22:01: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=L1MmGLhowMkEp3+3jZ4blj4L16FJ2J4LnmdalTZsoAw=; b=fT8ABgGgnE7dc7JKEqhztZc57y5uVfURFWAgXdtKvn3kHm/QTqSOgaPiY+jX5RHSou 83V6izCtnmWGfl35c8G2GNSwS7cBSIxG61ELQXM8cyBzILyx7RBNvGsB7iHDMjviFVRo KGmPzP3dTfIl2tNV/NPv0VyFljbae95zQJWCU= 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=L1MmGLhowMkEp3+3jZ4blj4L16FJ2J4LnmdalTZsoAw=; b=pgfn8mWTN5yQDCMT59cJ5HpIx9RbzDsM7h+f+4vEHK+Pw7uzzX9p1hSFLwwAtOkLiS rVOjKlvMBJ68jxH7InMj+rhVGQ9ESIsLCIVrPrTgsKQ0lrbdbEr1WBDAd2CXCtgYzCDr xQ4S2+lX0T/FG3LRRDUVS1TJjfc6zNDV8QSLl8Jt/wz6sHfWwzv6ine4mqoK8CnBjjV5 Hu63KuMoyTp56Z9nZgg8uzGwNzT8JnH6qc7LG65/ylmhu9/xgzyYpt0tqr/t1m0TJhfA LBJVcX8rGiNhS1QfvJSbZVQ30hbivH+rDaxfO9R3PwCdSt2tlR9rpgD/kCCPFYFeOAn8 lysA== X-Gm-Message-State: AGRZ1gKflBUnOsBilXWmYYlUobivWMzNuKLH9DyFkPMmdsewR+ax1qYQ /DD6ZIAtmBxWqUv5paw2uIhvCA== X-Received: by 2002:a63:193:: with SMTP id 141mr3580631pgb.136.1542088869009; Mon, 12 Nov 2018 22:01: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 r6-v6sm19150204pfk.157.2018.11.12.22.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 22:01:08 -0800 (PST) From: Firoz Khan To: Geert Uytterhoeven , linux-m68k@lists.linux-m68k.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 v5 1/3] m68k: add __NR_syscalls along with NR_syscalls Date: Tue, 13 Nov 2018 11:30:27 +0530 Message-Id: <1542088829-19790-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542088829-19790-1-git-send-email-firoz.khan@linaro.org> References: <1542088829-19790-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 m68k 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_syscalls value. 1. Update NR_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to up- date NR_syscalls until we either add a new sys- tem call or delete existing system call. 2. We can keep this feature it above mentioned sc- ript, that will 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 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 implement- ation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan --- arch/m68k/include/asm/unistd.h | 3 +-- arch/m68k/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index e680031..49d5de1 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -4,8 +4,7 @@ #include - -#define NR_syscalls 380 +#define NR_syscalls __NR_syscalls #define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h index de3054f..ba4176aa 100644 --- a/arch/m68k/include/uapi/asm/unistd.h +++ b/arch/m68k/include/uapi/asm/unistd.h @@ -387,4 +387,8 @@ #define __NR_pwritev2 378 #define __NR_statx 379 +#ifdef __KERNEL__ +#define __NR_syscalls 380 +#endif + #endif /* _UAPI_ASM_M68K_UNISTD_H_ */