From patchwork Wed Jan 2 14:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10746483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E677617D2 for ; Wed, 2 Jan 2019 14:56:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D728D28862 for ; Wed, 2 Jan 2019 14:56:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB377288A6; Wed, 2 Jan 2019 14:56:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52AE328894 for ; Wed, 2 Jan 2019 14:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729377AbfABO4x (ORCPT ); Wed, 2 Jan 2019 09:56:53 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46324 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729641AbfABO4v (ORCPT ); Wed, 2 Jan 2019 09:56:51 -0500 Received: by mail-pg1-f196.google.com with SMTP id w7so14671387pgp.13 for ; Wed, 02 Jan 2019 06:56:49 -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=PE7tuPVD5ji389rrnaCznzLxbmlbwQF30eStDamFN0I=; b=OIiEqvn8P3Gv2S9b//iL2+G1CwFUU985SGmKBytRaaODKFSpllQnYB6g+zJdesH/kH 4vpLyyq/WJBwYzhxcO61pyK39hYavWXri4rBilsICuUs4rxCNVdnO6Ewl7SKlvx74meu 74ztBJEPmk2GWXZGcfBj7bq3WGVk4xmN4zShE= 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=PE7tuPVD5ji389rrnaCznzLxbmlbwQF30eStDamFN0I=; b=HUEuRSyVaSiJCFy751CIH3CsU29W7B0bg4LxUNKgNJ9ziEXHwIZDjZDsqDIUuKHSRD XBHCffQG3CgWlcxm84/j8dd/GdIErLp2j8T/uJLQOAe+z/5JIBgfR7aivmJOoBxgmtkI X/fj0RayIlipZRKiVzkgxv8NiFzkR9SxqfkvJHvTEwI/j1iCO4DOKIHZ1EFDoZwfFa0M 9g82nx3PZMyz6aMzXOgGkzUdvTBij8KanfWopun9ZBrQuKh5+bUwml9TitVctHd2Ufb0 fGMkQtczOTgduTz7rOCSEDA0JrAB8luuAxS/b8/D7IzRPZf8EdOPFk7a3TVOuXP2W1/2 jD/g== X-Gm-Message-State: AJcUukeKAwD77YhxyPVxCufCi6t0WTmdHcyBWZgWZU14ckINjMxO5X5U g/7jDyWJgRN8Yi88asHsOAP4kw== X-Google-Smtp-Source: ALg8bN61X9RMFtoxayM0/1Og3lLQI+KIiBGAao2V4BKlZCBlJtWbiz/47NR0f0cVVe7y7oDRMuxtgw== X-Received: by 2002:a63:7e1a:: with SMTP id z26mr30008986pgc.216.1546441009526; Wed, 02 Jan 2019 06:56:49 -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 5sm96745685pfz.149.2019.01.02.06.56.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 06:56:49 -0800 (PST) From: Firoz Khan To: Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.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 1/2] mips: remove nargs from __SYSCALL Date: Wed, 2 Jan 2019 20:26:17 +0530 Message-Id: <1546440978-19569-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546440978-19569-1-git-send-email-firoz.khan@linaro.org> References: <1546440978-19569-1-git-send-email-firoz.khan@linaro.org> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The __SYSCALL macro's arguments are system call number, system call entry name and number of arguments for the system call. Argument- nargs in __SYSCALL(nr, entry, nargs) is neither calculated nor used anywhere. So it would be better to keep the implementaion as __SYSCALL(nr, entry). This will unifies the implementation with some other architetures too. Signed-off-by: Firoz Khan --- arch/mips/kernel/scall32-o32.S | 2 +- arch/mips/kernel/scall64-n32.S | 2 +- arch/mips/kernel/scall64-n64.S | 2 +- arch/mips/kernel/scall64-o32.S | 2 +- arch/mips/kernel/syscalls/syscalltbl.sh | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index d9434cd..b449b68 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S @@ -217,7 +217,7 @@ einval: li v0, -ENOSYS #define sys_sched_getaffinity mipsmt_sys_sched_getaffinity #endif /* CONFIG_MIPS_MT_FPAFF */ -#define __SYSCALL(nr, entry, nargs) PTR entry +#define __SYSCALL(nr, entry) PTR entry .align 2 .type sys_call_table, @object EXPORT(sys_call_table) diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index c761ddf..35d8c86 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -101,7 +101,7 @@ not_n32_scall: END(handle_sysn32) -#define __SYSCALL(nr, entry, nargs) PTR entry +#define __SYSCALL(nr, entry) PTR entry .type sysn32_call_table, @object EXPORT(sysn32_call_table) #include diff --git a/arch/mips/kernel/scall64-n64.S b/arch/mips/kernel/scall64-n64.S index 727fb8a..23b2e2b 100644 --- a/arch/mips/kernel/scall64-n64.S +++ b/arch/mips/kernel/scall64-n64.S @@ -109,7 +109,7 @@ illegal_syscall: j n64_syscall_exit END(handle_sys64) -#define __SYSCALL(nr, entry, nargs) PTR entry +#define __SYSCALL(nr, entry) PTR entry .align 3 .type sys_call_table, @object EXPORT(sys_call_table) diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index f158c58..e229155 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -213,7 +213,7 @@ einval: li v0, -ENOSYS jr ra END(sys32_syscall) -#define __SYSCALL(nr, entry, nargs) PTR entry +#define __SYSCALL(nr, entry) PTR entry .align 3 .type sys32_call_table,@object EXPORT(sys32_call_table) diff --git a/arch/mips/kernel/syscalls/syscalltbl.sh b/arch/mips/kernel/syscalls/syscalltbl.sh index acd338d..1e25707 100644 --- a/arch/mips/kernel/syscalls/syscalltbl.sh +++ b/arch/mips/kernel/syscalls/syscalltbl.sh @@ -13,10 +13,10 @@ emit() { t_entry="$3" while [ $t_nxt -lt $t_nr ]; do - printf "__SYSCALL(%s, sys_ni_syscall, )\n" "${t_nxt}" + printf "__SYSCALL(%s,sys_ni_syscall)\n" "${t_nxt}" t_nxt=$((t_nxt+1)) done - printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}" + printf "__SYSCALL(%s,%s)\n" "${t_nxt}" "${t_entry}" } grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( From patchwork Wed Jan 2 14:56:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10746485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF2E914E2 for ; Wed, 2 Jan 2019 14:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADEEB28862 for ; Wed, 2 Jan 2019 14:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2016288A6; Wed, 2 Jan 2019 14:57:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1560828862 for ; Wed, 2 Jan 2019 14:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729702AbfABO44 (ORCPT ); Wed, 2 Jan 2019 09:56:56 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41790 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729701AbfABO4z (ORCPT ); Wed, 2 Jan 2019 09:56:55 -0500 Received: by mail-pg1-f193.google.com with SMTP id m1so14692743pgq.8 for ; Wed, 02 Jan 2019 06:56: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=AZpMXadv7N+HBsKpir5Le3ZPxvZAqE7DPpdjcjx0uwU=; b=jHfbseUNtttCualNw9t94SDtdc8ElaepYh15xpb0kpx9V6TEQciFQFV9kWnPGeNb4C ae8jwZxAGJf51YD8k35hl+RNVN1XQrYrRZh1EE5KbrFLLFJwLosmS4DNc0I0Lxg5pw0X UhyV/kuS40hJjkcQ7yXy9kt3jii5/tLvIiqD4= 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=AZpMXadv7N+HBsKpir5Le3ZPxvZAqE7DPpdjcjx0uwU=; b=Ta069IzthOi2XcODb5yQ72koKUodCq/iWTYoA/aGDMjGTySwQF8WM9F7Nau44SCVcl j6kNllzsw5N5nFOLrh8UVhCnLkNA/puNUUhZQAI6a98kEjcwSQMA3leq+vZn3Wkrok+7 /dC7YvRcuK0H5Lgq1YgivFSQISmp5RzOwJEIdyUzTYcZ2WdCg54gI67YsBAnTtvAEAgs aFHjxuWwwK1O3SA+zMPt/FJ3GgFrRdLSjdopg4AYQpISaqQ6BhF2SvdsXoqoQQMVOxDA oeBCPI70+gccnterQ3UPW/7gQD6F22RNSKKCCJYI8ji0OE1dzfIoEGzCs2li35dt/N15 yFEQ== X-Gm-Message-State: AJcUukdca1/BQbLCEJq1Xr2PjvQPwwhT4wjcsOra4KZZNR20+Psdgdfn IFHWgd2iljwYkOZFVlxCKRyVJw== X-Google-Smtp-Source: ALg8bN56XOiDOzIdVrMZJ+3UnqqTIDC7fLYzWWoYJS9cVpsNG8kAcoR1fLuNP35wtAsMIwq+1E5gkg== X-Received: by 2002:a63:d450:: with SMTP id i16mr41308693pgj.246.1546441014589; Wed, 02 Jan 2019 06:56:54 -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 5sm96745685pfz.149.2019.01.02.06.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 06:56:54 -0800 (PST) From: Firoz Khan To: Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.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 2/2] mips: generate uapi header and system call table files Date: Wed, 2 Jan 2019 20:26:18 +0530 Message-Id: <1546440978-19569-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546440978-19569-1-git-send-email-firoz.khan@linaro.org> References: <1546440978-19569-1-git-send-email-firoz.khan@linaro.org> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unified system call table generation script must be run to generate unistd_(nr_)n64/n32/o32.h and syscall_table- _32_o32/64_n64/64_n32/64-o32.h files. This patch will have changes which will invokes the script. This patch will generate unistd_(nr_)n64/n32/o32.h and syscall_table_32_o32/64_n64/64-n32/64-o32.h files by the syscall table generation script invoked by parisc/Make- file and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/scall32-o32/64-n64/64-n32/- 64-o32.Sfile. Signed-off-by: Firoz Khan --- arch/mips/kernel/syscalls/Makefile | 6 +++--- arch/mips/kernel/syscalls/syscallhdr.sh | 37 --------------------------------- arch/mips/kernel/syscalls/syscallnr.sh | 28 ------------------------- arch/mips/kernel/syscalls/syscalltbl.sh | 36 -------------------------------- 4 files changed, 3 insertions(+), 104 deletions(-) delete mode 100644 arch/mips/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/mips/kernel/syscalls/syscallnr.sh delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh diff --git a/arch/mips/kernel/syscalls/Makefile b/arch/mips/kernel/syscalls/Makefile index a3d4bec..8b7013e 100644 --- a/arch/mips/kernel/syscalls/Makefile +++ b/arch/mips/kernel/syscalls/Makefile @@ -8,9 +8,9 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ syscalln32 := $(srctree)/$(src)/syscall_n32.tbl syscalln64 := $(srctree)/$(src)/syscall_n64.tbl syscallo32 := $(srctree)/$(src)/syscall_o32.tbl -syshdr := $(srctree)/$(src)/syscallhdr.sh -sysnr := $(srctree)/$(src)/syscallnr.sh -systbl := $(srctree)/$(src)/syscalltbl.sh +syshdr := $(srctree)/scripts/syscallhdr.sh +sysnr := $(srctree)/scripts/syscallnr.sh +systbl := $(srctree)/scripts/syscalltbl.sh quiet_cmd_syshdr = SYSHDR $@ cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ diff --git a/arch/mips/kernel/syscalls/syscallhdr.sh b/arch/mips/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index d2bcfa8..0000000 --- a/arch/mips/kernel/syscalls/syscallhdr.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -out="$2" -my_abis=`echo "($3)" | tr ',' '|'` -prefix="$4" -offset="$5" - -fileguard=_UAPI_ASM_MIPS_`basename "$out" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ - -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` -grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( - printf "#ifndef %s\n" "${fileguard}" - printf "#define %s\n" "${fileguard}" - printf "\n" - - nxt=0 - while read nr abi name entry compat ; do - if [ -z "$offset" ]; then - printf "#define __NR_%s%s\t%s\n" \ - "${prefix}" "${name}" "${nr}" - else - printf "#define __NR_%s%s\t(%s + %s)\n" \ - "${prefix}" "${name}" "${offset}" "${nr}" - fi - nxt=$((nr+1)) - done - - printf "\n" - printf "#ifdef __KERNEL__\n" - printf "#define __NR_syscalls\t%s\n" "${nxt}" - printf "#endif\n" - printf "\n" - printf "#endif /* %s */" "${fileguard}" - printf "\n" -) > "$out" diff --git a/arch/mips/kernel/syscalls/syscallnr.sh b/arch/mips/kernel/syscalls/syscallnr.sh deleted file mode 100644 index 60bbdb3..0000000 --- a/arch/mips/kernel/syscalls/syscallnr.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -out="$2" -my_abis=`echo "($3)" | tr ',' '|'` -prefix="$4" -offset="$5" - -fileguard=_UAPI_ASM_MIPS_`basename "$out" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ - -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` -grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( - printf "#ifndef %s\n" "${fileguard}" - printf "#define %s\n" "${fileguard}" - printf "\n" - - nxt=0 - while read nr abi name entry compat ; do - nxt=$((nr+1)) - done - - printf "#define __NR_%s_Linux\t%s\n" "${prefix}" "${offset}" - printf "#define __NR_%s_Linux_syscalls\t%s\n" "${prefix}" "${nxt}" - printf "\n" - printf "#endif /* %s */" "${fileguard}" - printf "\n" -) > "$out" diff --git a/arch/mips/kernel/syscalls/syscalltbl.sh b/arch/mips/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index 1e25707..0000000 --- a/arch/mips/kernel/syscalls/syscalltbl.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -out="$2" -my_abis=`echo "($3)" | tr ',' '|'` -my_abi="$4" -offset="$5" - -emit() { - t_nxt="$1" - t_nr="$2" - t_entry="$3" - - while [ $t_nxt -lt $t_nr ]; do - printf "__SYSCALL(%s,sys_ni_syscall)\n" "${t_nxt}" - t_nxt=$((t_nxt+1)) - done - printf "__SYSCALL(%s,%s)\n" "${t_nxt}" "${t_entry}" -} - -grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( - nxt=0 - if [ -z "$offset" ]; then - offset=0 - fi - - while read nr abi name entry compat ; do - if [ "$my_abi" = "64_o32" ] && [ ! -z "$compat" ]; then - emit $((nxt+offset)) $((nr+offset)) $compat - else - emit $((nxt+offset)) $((nr+offset)) $entry - fi - nxt=$((nr+1)) - done -) > "$out"