From patchwork Fri Oct 26 05:13:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 149572 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp324720ljp; Thu, 25 Oct 2018 22:13:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5ek+Y6F6Uc8i0Soubmz3wNgSd94FG1qwlJl+WLUk7rWJ5MCotlioTn0TlIlRxc+fdzWOCww X-Received: by 2002:a17:902:e00a:: with SMTP id ca10-v6mr2076587plb.166.1540530836264; Thu, 25 Oct 2018 22:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540530836; cv=none; d=google.com; s=arc-20160816; b=ES+4mIp96bcyc2I+dL0XhLFIMKyxSsA/rSuTNS7HBXT/p7gLzogOeKKIfLXYbOoCf4 irv+t+PwC/9PWI7oTEOA5zl7vhYQcjSbB8U2SFUSQOnhScrW2Sw+AcZgBktmYoFQ6soM dQu4GYd5ZglBZ257/enDcX1u4SMCGZlDRU1KdKCebIOTM2gsRSm/oKTa0iEA81l3566e QR6fY7PlKYUd9cNCEWaHMuNAlqHEgEWTPYU3qqiOAj8IaPAmccWOmoCRiCczsetc4QvT MU6VKIzQDPhSvqgJDPzQTNxZjPpK5HWoe1mOdqrILdk8DG61IghrVRHF0Q/yc7AaLNaX SZqw== 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=gFcNXBX4l/6xItKhlgwTdqFlyHeCmRMGvdyUvQXs28g=; b=mh5/iJAhM6RVEbPeBXb7o9xcrRWSYe2+4h6/0tTYbCP9SJjU2NH8OYZdwo41hAuhKB w6+UA2Av74fyn1JegKnq82B0zi+QoUfhStsAiqQke4K4JbcWH3ijEKqHvnI8xFH4XTNC UfHvvCjNAJ1NfMwZ9cUVp1IYHU/WGW7wkKcT2s8/JzDLTMeilIKsTIl8LyW9n8ldH+e3 OqMzXDn/bnvwnb5zxEfjRA9kSUMEBkd2fW6rXpIbU/dk6GlnM/c4toHS1g2fRAku6qB3 cReqIOQDif/+XqDJax0L6VmsLYLxlZU7Zvl4uZWnJnZwbzLnN+Cl0VsFpvHN8lfpdaBm fWJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IiKyv8Fe; 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 s12-v6si10070944pgr.98.2018.10.25.22.13.56; Thu, 25 Oct 2018 22:13:56 -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=IiKyv8Fe; 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 S1726532AbeJZNtY (ORCPT + 32 others); Fri, 26 Oct 2018 09:49:24 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38792 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbeJZNtY (ORCPT ); Fri, 26 Oct 2018 09:49:24 -0400 Received: by mail-pf1-f196.google.com with SMTP id b11-v6so3675595pfi.5 for ; Thu, 25 Oct 2018 22:13:54 -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=gFcNXBX4l/6xItKhlgwTdqFlyHeCmRMGvdyUvQXs28g=; b=IiKyv8FeEAYyyW5ogH84j8mr5KrgMCL2k7oqKi7G8CsLL3y6G6zNO+ij0Mu8kNtdCN 0X+8FQrwVqUBMwysTfrZaMDyaUJ7Nc1ZOmua8mB8Mt4jkCKrCB59ZfIRVyldoguJblOS ozFKhVmdFoNK/AvMbS7Ya5chx7P/+cpZhAmXw= 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=gFcNXBX4l/6xItKhlgwTdqFlyHeCmRMGvdyUvQXs28g=; b=FlWdMGmOxSDAUjy+2IEinhgYB7B8m+6pwyGJj19r6cxJ2tEfH69s/N8HHzthJL1s+V YYYWDkqqDciUZiiVetVtjMVO7rnnnHp1A9WvyuGUgFotcZT+LUfs1LBCBS4gdqVbj2ea QYfmNtXYWoSbw426J9g52W1hFAtcPzVOdkMCGCEOdZdOD4254K041QkFrro21AnVxCbm L/p+27//ldemUZmKJmEpK51wkqI291DdVdSZxYT3zrqN4VRALBMZ0DyKImThxYxeb7pM ugz6JSt0CmBUQ4vIrUI/z/mUoF3XvzowGhWXKtaFpX2zSIjFVr+0rWdI/a/lR072xPQB 4g+w== X-Gm-Message-State: AGRZ1gJWIRqlKe6dPsds7Txe/vaoQ1Ak0/K3axU8IviSImIFOhAoGzWa DiMPOAXSOIYmSgDbMdwVHj34Kg== X-Received: by 2002:a63:f050:: with SMTP id s16-v6mr2054957pgj.403.1540530833916; Thu, 25 Oct 2018 22:13:53 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.61.165]) by smtp.gmail.com with ESMTPSA id m16-v6sm3329302pff.173.2018.10.25.22.13.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Oct 2018 22:13:53 -0700 (PDT) From: Firoz Khan To: linux-parisc@vger.kernel.org, "James E . J . Bottomley" , Helge Deller , 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 v6 2/5] parisc: add __NR_syscalls along with __NR_Linux_syscalls Date: Fri, 26 Oct 2018 10:43:08 +0530 Message-Id: <1540530791-3961-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540530791-3961-1-git-send-email-firoz.khan@linaro.org> References: <1540530791-3961-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 parisc 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 asm/unistd.h. The macro __NR_sys- calls 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/parisc/include/asm/unistd.h | 2 ++ arch/parisc/include/uapi/asm/unistd.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index 93fd9f6..d30fdbcb 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -4,6 +4,8 @@ #include +#define __NR_Linux_syscalls __NR_syscalls + #ifndef __ASSEMBLY__ #define SYS_ify(syscall_name) __NR_##syscall_name diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h index bb52e12..f10d065 100644 --- a/arch/parisc/include/uapi/asm/unistd.h +++ b/arch/parisc/include/uapi/asm/unistd.h @@ -366,7 +366,9 @@ #define __NR_statx (__NR_Linux + 349) #define __NR_io_pgetevents (__NR_Linux + 350) -#define __NR_Linux_syscalls (__NR_io_pgetevents + 1) +#ifdef __KERNEL__ +#define __NR_syscalls 351 +#endif #define LINUX_GATEWAY_ADDR 0x100