From patchwork Wed Jan 2 15:37:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10746495 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 940296C2 for ; Wed, 2 Jan 2019 15:37:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 837A22854A for ; Wed, 2 Jan 2019 15:37:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 773C72887E; Wed, 2 Jan 2019 15:37: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 23776287BD for ; Wed, 2 Jan 2019 15:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730167AbfABPhy (ORCPT ); Wed, 2 Jan 2019 10:37:54 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36312 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730164AbfABPhx (ORCPT ); Wed, 2 Jan 2019 10:37:53 -0500 Received: by mail-pg1-f193.google.com with SMTP id n2so14737256pgm.3 for ; Wed, 02 Jan 2019 07:37:53 -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=/Ij7bAJQ/5U9CidgRZ/FZU6EPo0eyUndCePkw9f7Oic=; b=axAiRYUaWlFs9Ldz2bFMrPP4FLLjPrRmq4si8No7x9W/9eEy2oEV/e2Pi5Lh/sZwGu GRL3G+leSm3ZUW/6Bnl9AaD6N0UjU4DRWcO6aQFDWgtO2Cqfetjuv7QMw/SlTqrCCn2W QcCZujtCXMQ+4pvjrLP0NkgUmDWMi3ZjFpXMU= 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=/Ij7bAJQ/5U9CidgRZ/FZU6EPo0eyUndCePkw9f7Oic=; b=uhneP+M+LYXIzj6e2534iXewei47UYwOqqaPLFOPmU9uUuz0quDq/wocURnqsS9JvI qI5AL9fZsYeYcSh16DOobUkLsdOG3ETprIB0c1FC8zlnqABq2PN8b882NmbD9Ag8ZwU1 vXN9u1WqejR4bnDqMgbBL6QTv65eqgPt7evTotWvFAGjFL23cWawxDvzUlYvkrnUY5g1 K2PAEZ1Rtk3H3wKK38rzfspWNjjih/cf3CmPv76yIOtqwdUZQHDJc8NJN+NuLJa1I45Q 8ORhBq/q3sfQer/JwCuX7m6JDqFdylhltlNpG+b5gZdHLHnS6TZX0F3IbI5s/GX3Fee4 +gLw== X-Gm-Message-State: AA+aEWY8wiQ2CWi1LazuzljmmJFpN/3ifxo/vaOZxoNoqJjr7oazrVz+ d7opJ6ATF9WxPZiGnKNY11hJuQ== X-Google-Smtp-Source: ALg8bN5crYtwoacCfkVnDCFm+N2hYXb0eKM30jk5QM9/Arbg/HmLV/c7g6xwI6gk4BjbMnPV7u+nuA== X-Received: by 2002:a62:6385:: with SMTP id x127mr45464796pfb.15.1546443472677; Wed, 02 Jan 2019 07:37:52 -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 c4sm108500721pfm.151.2019.01.02.07.37.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:37:52 -0800 (PST) From: Firoz Khan To: Yoshinori Sato , Rich Felker , Andrew Morton , Simon Horman , Kuninori Morimoto , linux-sh@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] sh: remove nargs from __SYSCALL Date: Wed, 2 Jan 2019 21:07:24 +0530 Message-Id: <1546443445-21075-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546443445-21075-1-git-send-email-firoz.khan@linaro.org> References: <1546443445-21075-1-git-send-email-firoz.khan@linaro.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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/sh/kernel/syscalls/syscalltbl.sh | 4 ++-- arch/sh/kernel/syscalls_32.S | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/sh/kernel/syscalls/syscalltbl.sh b/arch/sh/kernel/syscalls/syscalltbl.sh index 85d78d9..904b8e6 100644 --- a/arch/sh/kernel/syscalls/syscalltbl.sh +++ b/arch/sh/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 | ( diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 96e9c54..bd1a9c5 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S @@ -10,7 +10,7 @@ #include #include -#define __SYSCALL(nr, entry, nargs) .long entry +#define __SYSCALL(nr, entry) .long entry .data ENTRY(sys_call_table) #include From patchwork Wed Jan 2 15:37:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10746497 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 01B5714E2 for ; Wed, 2 Jan 2019 15:38:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E35772854A for ; Wed, 2 Jan 2019 15:38:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D65F42887E; Wed, 2 Jan 2019 15:38:06 +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 64DC22854A for ; Wed, 2 Jan 2019 15:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730193AbfABPh7 (ORCPT ); Wed, 2 Jan 2019 10:37:59 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36434 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730191AbfABPh7 (ORCPT ); Wed, 2 Jan 2019 10:37:59 -0500 Received: by mail-pl1-f196.google.com with SMTP id g9so14653628plo.3 for ; Wed, 02 Jan 2019 07:37:58 -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=RGqgaRXD6Ws2lx1y4vB0VL720ZVcv6fzuotxHip3TgQ=; b=eZ+N62KNyNKNjyjADYlggcmziP2/W0w3GpO1D2/SkMEgoWGo79Gco5+laDORNhPDP9 da2xjenXp34iC77kgbPmwPsxR9tPum7JAiBx2e2uZWaMFYRluJVta1QXG9y1t7NUwKvU M+1tJkNELG8OPpCPw8RmyxRGCYhfIC9VsVimM= 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=RGqgaRXD6Ws2lx1y4vB0VL720ZVcv6fzuotxHip3TgQ=; b=DshpsDK6Gxn8zcvcgXz5GJJe7k4zH5Fik2gGnv0MCTBEM8a7Il+ae2uxvoiIe1X9lU EUKVutAJWfzfetEOHCXWhbX8FxKbMCQT3VIZ7Sa4ANCCRdNcDJuftMytVf7ToqF+zBZG H3ZlxdgSodAy1MJisf3GiXYsYr1hA9biEe+8vnO/qDRfHQZXYiqLjOaozdkEChMpN/nx 58IZQHdQPMlKf5gbYd++IXtx9k3sM+7rdcTYYpn24XMwO377bJjh5cSFFxzQx0YfRHps /JqjiZKXjnSqgy0R+Rqo0CAT7z+++/+nYDcQiO/h+CEgll+n3gcJxGICqbDoxcUTlRrL gHow== X-Gm-Message-State: AJcUukcfsBHTeCJnvh8RbrUHE0Uov37XnygpD2L+TW6QyRE+gYfTVVcH LtLfV5Q1ydfq6NfCwDI2VZ7efA== X-Google-Smtp-Source: ALg8bN4IgPngY7Qr4wBMjRrH3fIbzASltXa6ywM6BLEvqeEPtGnOJP+1pvgLcdb3M/VUQFPpR2JpnQ== X-Received: by 2002:a17:902:14b:: with SMTP id 69mr44301439plb.52.1546443477605; Wed, 02 Jan 2019 07:37:57 -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 c4sm108500721pfm.151.2019.01.02.07.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:37:57 -0800 (PST) From: Firoz Khan To: Yoshinori Sato , Rich Felker , Andrew Morton , Simon Horman , Kuninori Morimoto , linux-sh@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] sh: generate uapi header and syscall table header files Date: Wed, 2 Jan 2019 21:07:25 +0530 Message-Id: <1546443445-21075-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546443445-21075-1-git-send-email-firoz.khan@linaro.org> References: <1546443445-21075-1-git-send-email-firoz.khan@linaro.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unified system call table generation script must be run to generate unistd_32.h and syscall_table.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32.h and syscall_table.h files by the syscall table generation script invoked by sh/Makefile 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/syscall_32.S file. Signed-off-by: Firoz Khan --- arch/sh/kernel/syscalls/Makefile | 11 +++++++++-- arch/sh/kernel/syscalls/syscallhdr.sh | 36 ----------------------------------- arch/sh/kernel/syscalls/syscalltbl.sh | 32 ------------------------------- 3 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 arch/sh/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh diff --git a/arch/sh/kernel/syscalls/Makefile b/arch/sh/kernel/syscalls/Makefile index 659faef..75c7421 100644 --- a/arch/sh/kernel/syscalls/Makefile +++ b/arch/sh/kernel/syscalls/Makefile @@ -6,8 +6,9 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') syscall := $(srctree)/$(src)/syscall.tbl -syshdr := $(srctree)/$(src)/syscallhdr.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)' '$<' '$@' \ @@ -15,6 +16,12 @@ quiet_cmd_syshdr = SYSHDR $@ '$(syshdr_pfx_$(basetarget))' \ '$(syshdr_offset_$(basetarget))' +quiet_cmd_sysnr = SYSNR $@ + cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ + '$(sysnr_abis_$(basetarget))' \ + '$(sysnr_pfx_$(basetarget))' \ + '$(sysnr_offset_$(basetarget))' + quiet_cmd_systbl = SYSTBL $@ cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \ '$(systbl_abis_$(basetarget))' \ diff --git a/arch/sh/kernel/syscalls/syscallhdr.sh b/arch/sh/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index 1de0334..0000000 --- a/arch/sh/kernel/syscalls/syscallhdr.sh +++ /dev/null @@ -1,36 +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_SH_`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 ; 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}" -) > "$out" diff --git a/arch/sh/kernel/syscalls/syscalltbl.sh b/arch/sh/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index 904b8e6..0000000 --- a/arch/sh/kernel/syscalls/syscalltbl.sh +++ /dev/null @@ -1,32 +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 ; do - emit $((nxt+offset)) $((nr+offset)) $entry - nxt=$((nr+1)) - done -) > "$out"