From patchwork Fri Sep 14 08:38:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 146694 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp434201ljw; Fri, 14 Sep 2018 01:39:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYzoc8WT9b8zr/K0wHS+CTIKBHKxvhBCNVuqwsdTUrnataAPPQDs89UcvWpljr6jO/hldjP X-Received: by 2002:a62:ee06:: with SMTP id e6-v6mr11465437pfi.2.1536914354906; Fri, 14 Sep 2018 01:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536914354; cv=none; d=google.com; s=arc-20160816; b=b09T8tx4KB4thIybG9r1GZ+b7odS/DCm0YYhtB/asJ2C87hmnhok9jkqGIHBJ8PwQF jcP4jRLKa0Lmt9L3Ydyw+LZcjLSzJ4OGCUW58FIFRol+nUh9rwjkTzvfkW2QJ/DKIScH 6wR75LjgXXLDYTqyMC7nl/9TqRtWdcD0MexDw4/er6+n9Q4tOCb/qIHa5kh6BZMZzv6r wB/LVEMp43kMuoOrxLlbziC8yE3N40yJyegJ6GAI44UGVOKI4F1XuP2EhffNReS48WuI TDNTTd9dVNeg73OiUXhObyV+6Uzlu5exiTC8UjnxnwR+n/lMKPsfZiwaJBQHZ7frazT+ QLhw== 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=qmk9tdmyCNAX0uYS98kxHvRp3zsest+IBqTfinGmuMM=; b=uszE4VK3GfqoOIXO7GrpXpGspYb5DJ1QnroJYoTNxx+gIBy+jEp/nCjYpBn+nDyBMY zRaYRtr4f5cc6G918ZPsvuWzYE+Bc4wxoxTgVWLf+CVwsvyMs6mxLQReJ+qlVoCSKszj +UptYS18GqeNjjsRCbO4cmFXAwmuQlqeSygXX6LyiwGg8msk0bOrk0EoCN6f7XxfLcx5 xzDGYYIvIwT7THfgFyHvyjrQkPJAMziV6LhZO6B3MeUSIyYZksQ7NeI8o7j0BUsAv/QH OHm8co9pi4+AqFlnsE3xOyxZ35CS9bx1B4XkfjDdFST30ctpOPnw/aXPKQuqTTASXDvI Z6jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zje1zK3B; 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 n2-v6si6974728pgu.103.2018.09.14.01.39.14; Fri, 14 Sep 2018 01:39:14 -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=Zje1zK3B; 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 S1727872AbeINNwj (ORCPT + 32 others); Fri, 14 Sep 2018 09:52:39 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33186 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727944AbeINNwi (ORCPT ); Fri, 14 Sep 2018 09:52:38 -0400 Received: by mail-pf1-f194.google.com with SMTP id d4-v6so3991461pfn.0 for ; Fri, 14 Sep 2018 01:39:12 -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=qmk9tdmyCNAX0uYS98kxHvRp3zsest+IBqTfinGmuMM=; b=Zje1zK3Bnbi+aIOYb0gSn4xU3rKqZP088NnH6u+iImR/bexjjon0SHWVGeZxDU3dQH icV4e+hlASBIOkWVmYGpY97Iyjn0rMWqiz85PWCQP8LCz48B4jp2KswkxpRHZYz5weJL pZ62Z9RnnzLFp/7yXjrJXkps+yzpOvZxgMPUM= 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=qmk9tdmyCNAX0uYS98kxHvRp3zsest+IBqTfinGmuMM=; b=fFcX+qH96WZD0FQoWl/+Q6C1aMuMqd8IiUVFRbv9a9y9JCBrZI540mUHWkjJlnCyjz d/fcXOLmy1C1P7R4aXSOqd7MNdC7AaPFFnADFlu6Orz+eNve5ORpJGf5kmdkU1tLTeTN bMI0p+xWyEop+ihTvnwawciShX8MqxCpF8VTD+aZAu3ZIbh3ft7JViYVtWuhj8oOTG1a i/mp8n2GUfaMyQeSVG283s2jY9WJEQbBQwCK/F7ufHmOtJK/7r5De6xYRxMNCW1ngGgp 0fj46BkxiuZ1FgKBjRL2+VTDC/ltmmCqnKes/jLai2IBd3ZERTJfhTbDmD5/dFWVYLs4 Hccw== X-Gm-Message-State: APzg51CjG6uj/ifzJrElLIi0vvq/CeQjw7n3bnWYm6IFBKHF2CIOK0yG L+NQ92SkwIz4ztj8MvJ7ttkEAg== X-Received: by 2002:a63:3587:: with SMTP id c129-v6mr10749967pga.290.1536914352128; Fri, 14 Sep 2018 01:39:12 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.60.83]) by smtp.gmail.com with ESMTPSA id c1-v6sm11664289pfg.25.2018.09.14.01.39.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Sep 2018 01:39:11 -0700 (PDT) From: Firoz Khan To: Hauke Mehrtens , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , linux-mips@linux-mips.org, Ralf Baechle , Paul Burton , James Hogan , 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 1/3] mips: Add __NR_syscalls macro in uapi/asm/unistd.h Date: Fri, 14 Sep 2018 14:08:32 +0530 Message-Id: <1536914314-5026-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536914314-5026-1-git-send-email-firoz.khan@linaro.org> References: <1536914314-5026-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 MIPS architecture. This macro is currently not a part of uapi/asm/unistd.h file. The purpose of this macro is 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 uapi/asm/unistd.h manually by counting the no.of system calls. No need to update NR_syscalls until 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. 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/mips/include/uapi/asm/unistd.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index f25dd1d..f8bab34 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h @@ -390,17 +390,17 @@ #define __NR_statx (__NR_Linux + 366) #define __NR_rseq (__NR_Linux + 367) #define __NR_io_pgetevents (__NR_Linux + 368) - +#define __NR_syscalls 368 /* * 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 @@ -737,16 +737,17 @@ #define __NR_statx (__NR_Linux + 326) #define __NR_rseq (__NR_Linux + 327) #define __NR_io_pgetevents (__NR_Linux + 328) +#define __NR_syscalls 328 /* * 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 @@ -1087,15 +1088,16 @@ #define __NR_statx (__NR_Linux + 330) #define __NR_rseq (__NR_Linux + 331) #define __NR_io_pgetevents (__NR_Linux + 332) +#define __NR_syscalls 332 /* * 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 */