From patchwork Thu Nov 15 06:14:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 151188 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6611117ljp; Wed, 14 Nov 2018 22:14:58 -0800 (PST) X-Google-Smtp-Source: AJdET5fDOp+59b3puEJXfbm4/rY6oV3Xq1dNjnqzdjqmMgxWgHtjtlGSsWeKyvbimy1xwNwu7ZGQ X-Received: by 2002:a62:571b:: with SMTP id l27-v6mr5126877pfb.209.1542262497911; Wed, 14 Nov 2018 22:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542262497; cv=none; d=google.com; s=arc-20160816; b=qKiWcEF6n3GksPrp4J43EcYbBaYDoqmBtB3scBT/NVZ0vbOdQPVirgmGvJNOl9TXar 6h5bwfSXfH7fyFpYzxpSYAqN7lMmCbtFFNkjHmiNxKE7xUkb6qpDliueGdgDlxiLVlmX QXSCBYxcZBHIfqAsEJnIV3eOjD1IlwHBT4+mbQewMgjBqSE5MIcXkr04iD1RyBYIMnjl BBzQQ/nUhTMQiD/P953Z7X9T3kX7h5B8FJvj+onWfHzD1m95hDzBHTBQKWgqLqGPumeM agaxXOUFWfL3oPBEkVBYJ5hc+NgBgp2ucG88sCNyN0ilFp5dQdKrf4HpRVFAYfnkk2zw b+Ww== 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=UOD1rZ76ixX1i+wINT/mXb9qg93tcveUQSdF4DVLxOg=; b=0Upg9BzMax2TZJgIltyNwsQZT4toEBdKvsOhev+ShcN0gp9T0TfG2omQ7FA/afkYGB +ZUuZPNX4iYuuDmvvWBC4W1RvzXeMsYlenXJ52Ew8hOI/0kbYtxQlq91MG3PVUS7MNtM Av1ojDEEaWDqgkX7jF7prCllvi+vboYCv8d6h6UfrGa2fNqUlj5KPLeWWvgnm8FmQKOr pP+vx9uC+djtOj/tQv1+cYnbZ4bBctAtMyyon2NoG8zhJCZHr1waXOl85h+7UsBC+nLQ CxBEJolNJUmYYXZON95XyQMhvSaEceGYNBzW6XJbv7Amj+82jAsD6iCdsSTNmpdGNzth EifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j5Qgb6da; 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 b11-v6si27816771plk.406.2018.11.14.22.14.57; Wed, 14 Nov 2018 22:14:57 -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=j5Qgb6da; 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 S1728630AbeKOQVY (ORCPT + 32 others); Thu, 15 Nov 2018 11:21:24 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40100 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbeKOQVY (ORCPT ); Thu, 15 Nov 2018 11:21:24 -0500 Received: by mail-pf1-f196.google.com with SMTP id x2-v6so9158415pfm.7 for ; Wed, 14 Nov 2018 22:14:55 -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=UOD1rZ76ixX1i+wINT/mXb9qg93tcveUQSdF4DVLxOg=; b=j5Qgb6datx6I8r5gBbqyz1u7DqEgvrQZAAVbzPbs9C5F46EZlv1PH9WpcF1s5ZWFRE ePdLA/+ukMxSAiQA+TlhpUED4GCqHsCiSZGTo3dVIJXAez7Y/V5by/792WXxQZscNAtC EDQ6TAtmLTdWJZ3Mm6/IgAQXYoMhFnDp3mOTs= 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=UOD1rZ76ixX1i+wINT/mXb9qg93tcveUQSdF4DVLxOg=; b=gX7DUivhN7oOdw4xYdEGVPb329qW6wqus2vh7ep/SFoYPvRHAtp7IF9s9SA5n+jWjX 5EC4C0bzg7IlCdtFiyBNPBu6riePumtorLpZ/E3r2mnFKkFA9RXsUUDaJ/wO82l69sl8 LjHPErREdvtH7V9X1cWZHSs3q5FoNw0aOTMPYBDYYu1pFIvoZmpDDPwd1M93obCQ7cNE CooqoBQCYfVgaIZ3ar1ERQ5c8r6A6+ocB9PuYoD3FvDgH1TSDbuj7j54hvg9CputRvUn f2J4oZu4GS9YdOiiiMnxVYg2QEOhtNY5KpSG0xTG9IJPVOV3cunDXGmwtSUubjJUlFYJ YbGg== X-Gm-Message-State: AGRZ1gKLuHViJWaoE8/kxMgBRg4toF0Jb4Ql1YCS3xT6rkMiSKuYdWrM cATGR6K10xmaUroMKFi1qxUI8Q== X-Received: by 2002:a63:f658:: with SMTP id u24mr4659976pgj.267.1542262495383; Wed, 14 Nov 2018 22:14:55 -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 34sm39861931pgp.90.2018.11.14.22.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 22:14:54 -0800 (PST) From: Firoz Khan To: Ralf Baechle , Paul Burton , James Hogan , linux-mips@linux-mips.org, Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , Kate Stewart Cc: Arnd Bergmann , 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 v2 1/5] mips: add __NR_syscalls along with __NR_Linux_syscalls Date: Thu, 15 Nov 2018 11:44:17 +0530 Message-Id: <1542262461-29024-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542262461-29024-1-git-send-email-firoz.khan@linaro.org> References: <1542262461-29024-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_Linux_syscalls macro holds the number of system call exist in mips architecture. We have to change the value of __NR_Linux_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- _Linux_syscalls value. 1. Update __NR_Linux_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR_Linux_syscalls 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_Linux_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_Linux_syscalls. 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/mips/include/uapi/asm/unistd.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index f25dd1d..0ccf954 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h @@ -391,16 +391,19 @@ #define __NR_rseq (__NR_Linux + 367) #define __NR_io_pgetevents (__NR_Linux + 368) +#ifdef __KERNEL__ +#define __NR_syscalls 368 +#endif /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 368 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ #define __NR_O32_Linux 4000 -#define __NR_O32_Linux_syscalls 368 +#define __NR_O32_Linux_syscalls __NR_syscalls #if _MIPS_SIM == _MIPS_SIM_ABI64 @@ -738,15 +741,19 @@ #define __NR_rseq (__NR_Linux + 327) #define __NR_io_pgetevents (__NR_Linux + 328) +#ifdef __KERNEL__ +#define __NR_syscalls 328 +#endif + /* * Offset of the last Linux 64-bit flavoured syscall */ -#define __NR_Linux_syscalls 328 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #define __NR_64_Linux 5000 -#define __NR_64_Linux_syscalls 328 +#define __NR_64_Linux_syscalls __NR_syscalls #if _MIPS_SIM == _MIPS_SIM_NABI32 @@ -1088,14 +1095,18 @@ #define __NR_rseq (__NR_Linux + 331) #define __NR_io_pgetevents (__NR_Linux + 332) +#ifdef __KERNEL__ +#define __NR_syscalls 332 +#endif + /* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 332 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ #define __NR_N32_Linux 6000 -#define __NR_N32_Linux_syscalls 332 +#define __NR_N32_Linux_syscalls __NR_syscalls #endif /* _UAPI_ASM_UNISTD_H */