From patchwork Wed Jan 2 16:02:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10746523 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 517266C2 for ; Wed, 2 Jan 2019 16:03:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFE328765 for ; Wed, 2 Jan 2019 16:03:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 334972882E; Wed, 2 Jan 2019 16:03:08 +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 A90E928765 for ; Wed, 2 Jan 2019 16:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730324AbfABQDH (ORCPT ); Wed, 2 Jan 2019 11:03:07 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34112 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730321AbfABQDH (ORCPT ); Wed, 2 Jan 2019 11:03:07 -0500 Received: by mail-pg1-f194.google.com with SMTP id j10so14767338pga.1 for ; Wed, 02 Jan 2019 08:03:06 -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=Q8Sr5ThZMKRXocJdw2zivcshx9cGsDEOtoQKtsu1DjU=; b=UeOpEcpTukVAkxrdNciikTb/mnIsLxRZzAW1QMXW+vHq6h5bDIZty8KzZ+7lsTSdqX WBHgZEdt47qCMQ8ye122LT+7ULYfnuvJJYLfK2Yf5RqqLDWUkm3o1y1gEIyeOz4+BNTM ZLw7z749QfXZ59ptesovKJgNPJyAqLOHPkwB4= 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=Q8Sr5ThZMKRXocJdw2zivcshx9cGsDEOtoQKtsu1DjU=; b=ejq5wdCiLJ0t7p/mVAmtmBzeVlalB3wnZaav7EDgac/LZiE61nqH3BCxMlzii3yL6V F/1YmHXZAlOkrRVrtrvlUnd9T2Cqf8woNKJmBZpGhkZIbKsXWCXYTfifgDnngB2GxoGL 5Djx2kDUmqoMAply7S6A2fwI2cpRh31Xrfud2wW5E3Tjk9e2yFh/O+2tw9+ztwO5/Lbd qgyXgrGMFfUpwfjMMctEreyGcGFOs7TRhvi16uIxRdnKEKvUdRozs2KonFJOV5+INRhV fImOMjmlzuT7CXpSdJedRjWO6enqlbAh1OOymMnzfhYh6JvAuR7DEkDHmCku4fDjmzGQ gwSg== X-Gm-Message-State: AJcUukeLID46h8GtB/OycCCUUbtH+eUhipKmmIWsWAG4XBMsm3TEr691 1kuXCoqPuV45n1zI5ecSQgieDw== X-Google-Smtp-Source: ALg8bN7THPa15CPxPIPFlC0lo39ITdCHAX9p7mYkZJ2/1b5dhFudxUbWnvIOG3O50vhmJct2v0VDeA== X-Received: by 2002:a63:c051:: with SMTP id z17mr13623516pgi.20.1546444985915; Wed, 02 Jan 2019 08:03:05 -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 s2sm104344924pfa.167.2019.01.02.08.03.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 08:03:05 -0800 (PST) From: Firoz Khan To: "James E . J . Bottomley" , Helge Deller , John David Anglin , Matthew Wilcox , linux-parisc@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, Firoz Khan Subject: [PATCH 2/2] parisc: generate uapi header and system call table files Date: Wed, 2 Jan 2019 21:32:33 +0530 Message-Id: <1546444953-21630-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546444953-21630-1-git-send-email-firoz.khan@linaro.org> References: <1546444953-21630-1-git-send-email-firoz.khan@linaro.org> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Firoz Khan Unified system call table generation script must be run to generate unistd_32/64.h and syscall_table_32/64/c32.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32/64.h and syscall_table- _32/64/c32.h files by the syscall table generation script invoked by parisc/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.S file. Signed-off-by: Firoz Khan --- arch/parisc/kernel/syscalls/Makefile | 11 ++++++++-- arch/parisc/kernel/syscalls/syscallhdr.sh | 36 ------------------------------- arch/parisc/kernel/syscalls/syscalltbl.sh | 36 ------------------------------- 3 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 arch/parisc/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh diff --git a/arch/parisc/kernel/syscalls/Makefile b/arch/parisc/kernel/syscalls/Makefile index c22a21c..e24272d 100644 --- a/arch/parisc/kernel/syscalls/Makefile +++ b/arch/parisc/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/parisc/kernel/syscalls/syscallhdr.sh b/arch/parisc/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index 50242b7..0000000 --- a/arch/parisc/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_PARISC_`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}" -) > "$out" diff --git a/arch/parisc/kernel/syscalls/syscalltbl.sh b/arch/parisc/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index f7393a7..0000000 --- a/arch/parisc/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" = "c32" ] && [ ! -z "$compat" ]; then - emit $((nxt+offset)) $((nr+offset)) $compat - else - emit $((nxt+offset)) $((nr+offset)) $entry - fi - nxt=$((nr+1)) - done -) > "$out"