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"