From patchwork Wed Jan 2 15:52:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 154674 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp313230ljp; Wed, 2 Jan 2019 07:53:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6jnc9+u/QoT4lIPZE0lidw7p0f8h+ecxeAKyOjbakB6O8XG5oo/9v+eTj7IfZ1v/F67fN8 X-Received: by 2002:a63:2406:: with SMTP id k6mr13495250pgk.229.1546444412715; Wed, 02 Jan 2019 07:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546444412; cv=none; d=google.com; s=arc-20160816; b=Rfgxd5n6ryJorktHTKW4Z9nCYKoimCPCCuv+go7ghfv/Mhedu78ADfxSQRczfNHzIV ZNEgjl7zmgC5llNlkm3GqOC433SiKF4++EqP0pvym/s1c3Rypk28U3RF9mWE7UT/rr97 tdMcX/HeP6FiNDYxyoIsut85B0ektYl1JXmJ/0LQ3d6FhHvBuFTZpNorFHgSRGVu8aeR zi6goztGmizsmuPlvW09vWpVSkxczIIFgmK2uNu4pDj9cjpEENTcBWL8mXP4B+HJB0ND T8t+nGTqKA+LuFLFXBuxIa8EQL8kmdQgfsMN9zMsDn9ev5+bWewaIjh1qLNCkPXr00Tz 6vYQ== 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=/6QIRkSywJIAMa7P20oR43mtkBtoVMs6c6JfHglievg=; b=W3EsSFUBOh2o213Qma92QJPjaUIwnGoR5FWPzJfNk4lQPI0rL78dGW9vVSSXoQXqwC HKOjiBCnu8I+jvyWMqUKo/Aa+vFqWws+wy8fQutzgSH7RgE6dzA2O+Mp8qyv/7k9O6YS HDFq/02ucGIwhLoL6CzW06iuXI7gMBfCW794fk/PT7poxGHsShpczPQ7Z/Vkws2pEG66 ZC78DQG7GCwGd/6igcG217QRLBLx7N4Tgu69o6/OoY/WCdUgTRwa4gZpPwwrJHna71o8 ICJKWUVWhDtIesbCxHG6r1xdn+h0KOc+m/ODKGMBCjW/xhY4JSvKmDRKY2K8Lz7oTFug 1hKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UvBut2rs; 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 p23si8863729pgk.312.2019.01.02.07.53.32; Wed, 02 Jan 2019 07:53:32 -0800 (PST) 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=UvBut2rs; 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 S1730317AbfABPxb (ORCPT + 31 others); Wed, 2 Jan 2019 10:53:31 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34786 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730301AbfABPx3 (ORCPT ); Wed, 2 Jan 2019 10:53:29 -0500 Received: by mail-pf1-f193.google.com with SMTP id h3so15356929pfg.1 for ; Wed, 02 Jan 2019 07:53:28 -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=/6QIRkSywJIAMa7P20oR43mtkBtoVMs6c6JfHglievg=; b=UvBut2rsd5wSSYOe0iapCEq1qfsXDQFns6i8u9tKA2rggBxhyfrXM8m4l3d2ZEDpa9 gypCnTqf08i9JwLUoBDx3zlmV77nxJ7KR9bjyRCycudqeda7Fqp4hqbavk3TOvDZRJuY dnoRQpsnQoPxurB8+XcinSUd5VYILZFFkAUCI= 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=/6QIRkSywJIAMa7P20oR43mtkBtoVMs6c6JfHglievg=; b=Qkt449Re7THk53qYX8AB83LuYX8dDeHcRH+yMTLmtRWaXeq/dLtGkLjjvR9KY6aqIc tz6zp4HOTFTzkAQZPC0HaHti0f61efFea5o2h9X6aQ6agBOeEZpocj91Zygo9WB/mCAt 8sEH9qJY4Za9pMC1Ep/OaCVA3sVBzFE0Kqeb3POppN76Yi6Clsx5/yVAcxXhr5S0seGe 41a3vplGUu8EOuzUZu3DiXMQNES91FTxOjPGVrD9HIpYdWF8CC+MBXf1kngliw48Opaf uNVY0mK2c/SbWiwjoDHuch7lJ7iR3bl7FppAYxrlsxMZwx9IX5+AMqXPTaPf3lSaWYzj MfmA== X-Gm-Message-State: AJcUuke/HFibELuC4d6ZMj7VZYHcNJ2eACINBhUd2RzmW89LdCK7uFaN kMk1Cv+5JA+TMDAj9CaX06WOgvLixPk= X-Received: by 2002:a62:8d4f:: with SMTP id z76mr46207397pfd.2.1546444408523; Wed, 02 Jan 2019 07:53:28 -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 n7sm95242637pff.36.2019.01.02.07.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:53:28 -0800 (PST) From: Firoz Khan To: "David S . Miller" , Al Viro , sparclinux@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 3/3] sparc: generate uapi header and system call table files Date: Wed, 2 Jan 2019 21:22:53 +0530 Message-Id: <1546444373-21386-4-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546444373-21386-1-git-send-email-firoz.khan@linaro.org> References: <1546444373-21386-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 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/systbls_32/64.S file. Signed-off-by: Firoz Khan --- arch/sparc/kernel/syscalls/Makefile | 11 ++++++++-- arch/sparc/kernel/syscalls/syscallhdr.sh | 36 -------------------------------- arch/sparc/kernel/syscalls/syscalltbl.sh | 36 -------------------------------- 3 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 arch/sparc/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh -- 1.9.1 diff --git a/arch/sparc/kernel/syscalls/Makefile b/arch/sparc/kernel/syscalls/Makefile index c22a21c..e24272d 100644 --- a/arch/sparc/kernel/syscalls/Makefile +++ b/arch/sparc/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/sparc/kernel/syscalls/syscallhdr.sh b/arch/sparc/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index 626b574..0000000 --- a/arch/sparc/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_SPARC_`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/sparc/kernel/syscalls/syscalltbl.sh b/arch/sparc/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index ffe954b..0000000 --- a/arch/sparc/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_nis_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"