From patchwork Wed Jan 2 15:12:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 154658 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp278248ljp; Wed, 2 Jan 2019 07:12:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN6tO5TKHcIrVO5ZeMc15JTGvPuLVSRjgmL/XpWTNcEDuRrI2VWZDah0sJ5bNhuM4wxRP62q X-Received: by 2002:a63:a064:: with SMTP id u36mr13926001pgn.145.1546441961788; Wed, 02 Jan 2019 07:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546441961; cv=none; d=google.com; s=arc-20160816; b=hFoeR5gbo9sICJ7RbO+GoXHqNkzuIhnQ0frhGk8E+aXgBMGUARJ70rdjyTLIvRD/zh j8ksGQDDzDMXBwG9pwt8qp4C/tdXsp+YsA3ULA03YVXPlc2DSuo9ED8a5PmVKTONMGxb 8G6oOT83AWMgbeqxJ4qLQ21UahKBKoPEfOP9/BHBrCx1g+P+OX7C2wqzmOENIhjqEQnO CbwXYjyZDBRsbApyXhrBUbJImlFjwNVhvtC+Qu5BOBsRu9gyGbCeDh+uHg69i2cYn9du WbCrVuEUq/icRUfi3jkPjrLr7l/Ao+i2iMMiKp6zsSpLFHJhb8S+T7SMA0e32lB0F205 OK6w== 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=LIqZtcUysKAm8krWOjdirshVKXnvZ56s0oUU0STAW48=; b=x59PIT7sBDxWow+a8lBVI0Wg00RKSHR+snSrmMs+U3LIZ7cDtG2S89cmcPcBA3ElAl UEzIu2Ux5seSH7a6BtHkKMQslFylojuVzShZQyrjjcTDMblpBDPusbYKwxGXzMELAAuK z0ppIYwD6hReeY9MtjF0wYI1mJFkGmDsba91RQzmDnuIDgFW/glxVLf4tWOpCUrtJ4Vn x+7sOa89TiN+bCPRT4qZy/09QLfCOcu2snw6EFwJb8Nh3ACuRn3TZFOe0s9x6rcqQiHa Jt//4SGk0QOVGS7wzoY/ZdBI6eQoDq7+mK1svlR15zARt0ALt4igHfAyvozFgkF+QpdU bWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HwqeFECH; 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 l9si1671412pgj.543.2019.01.02.07.12.41; Wed, 02 Jan 2019 07:12:41 -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=HwqeFECH; 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 S1730027AbfABPMj (ORCPT + 31 others); Wed, 2 Jan 2019 10:12:39 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37305 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729203AbfABPMi (ORCPT ); Wed, 2 Jan 2019 10:12:38 -0500 Received: by mail-pl1-f194.google.com with SMTP id b5so14631095plr.4 for ; Wed, 02 Jan 2019 07:12:37 -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=LIqZtcUysKAm8krWOjdirshVKXnvZ56s0oUU0STAW48=; b=HwqeFECH8EshBgmhz0JFJAIQO3uRY4Tu/YEJeEg1jUsSOj63mKxYeJeZOL9N95tYel f1ZZP6oSS2LMZPKbXpAvn4mdCvHe7z4X+6Ra5zf/w4UhCoC2nscUb/JgTdMUW3hy1eXw f/xJGZraHon6gWxINixYeKkfSojgoTot58oro= 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=LIqZtcUysKAm8krWOjdirshVKXnvZ56s0oUU0STAW48=; b=UGu/W2Z9ySbcsIBpi2N0PCJv0RIV41buu9E9Vk29u8mrzXaVwtvN7TF8PFkaQ2Sp0e IB8n69Ygn8QYAjjcBwEnpPisvW+N7U8dNbBKjK3DCAWmRloC7yTq6I4Gt67o0CNA29az 7qkDzlae24Lbr0HrDJJRHcMocOiw4gmY/XEIa+uZ3t2pRq91DhZ5VDBkUDn4fiz8XUPt 4JSr6gciMGdE74FR1iGEdLriTBZzqclOjrAv72Hs2iZtS8W/x5Y2a3GnK9VxRC0MTybq gLDRLUpyoxSSmU4fBLjrtx4PnpwU00Ym4q/bVUPx/6ISDzVlyXNek8UPSRoPMeh0Wu1o NG4Q== X-Gm-Message-State: AJcUukegcEDNI4AsqhlRjQivmvCFqNA9+WNHk2u1sQvbfFYzQAXuwyRs W2i3gVh0QuzPLOA43FCyA8PyVg== X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr43446449plb.238.1546441957371; Wed, 02 Jan 2019 07:12:37 -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 125sm94973786pfd.124.2019.01.02.07.12.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:12:36 -0800 (PST) From: Firoz Khan To: Michal Simek , 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] microblaze: generate uapi header and system call table files Date: Wed, 2 Jan 2019 20:42:04 +0530 Message-Id: <1546441924-20262-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546441924-20262-1-git-send-email-firoz.khan@linaro.org> References: <1546441924-20262-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.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 microblaze/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_table.S file. Signed-off-by: Firoz Khan --- arch/microblaze/kernel/syscalls/Makefile | 11 ++++++-- arch/microblaze/kernel/syscalls/syscallhdr.sh | 36 --------------------------- arch/microblaze/kernel/syscalls/syscalltbl.sh | 32 ------------------------ 3 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 arch/microblaze/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh -- 1.9.1 diff --git a/arch/microblaze/kernel/syscalls/Makefile b/arch/microblaze/kernel/syscalls/Makefile index 659faef..75c7421 100644 --- a/arch/microblaze/kernel/syscalls/Makefile +++ b/arch/microblaze/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/microblaze/kernel/syscalls/syscallhdr.sh b/arch/microblaze/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index 2e9062a..0000000 --- a/arch/microblaze/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_MICROBLAZE_`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/microblaze/kernel/syscalls/syscalltbl.sh b/arch/microblaze/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index 904b8e6..0000000 --- a/arch/microblaze/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"