From patchwork Wed Jan 2 15:02: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: 154652 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp267481ljp; Wed, 2 Jan 2019 07:02:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/VACC9ePdagIFiEZJtJzQ70i20rFn5ZJnH4wlay0Olwx1wItaxQnksUAw/mbYiw9gyxnfJP X-Received: by 2002:a62:5301:: with SMTP id h1mr44362107pfb.17.1546441369671; Wed, 02 Jan 2019 07:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546441369; cv=none; d=google.com; s=arc-20160816; b=DCC70+PEaByjIEByZNREtg5ggbu0o8kp64I8GbJpkF4Xlcj55+VcHC/KdnwPzn//LU WGUZu4oKuk73cZW1JuFgCnhgDXrn031KZHa35lJB4pJpY353S11M5ED2z7lukcmLnLC9 QrgOWk7LnacCa9Xc7CU4nc07UszHBDG+s4UGL78QrB7P43Hdcdy7pYxun5KG+Al2y8g8 7kCgnFKVUL8X9WMtEWWCuVVMRmZPu8bxhFURCLehobBR+HzuHpKcgad5IPO78Pxh4VPK 4wJLtfTtL9UvnuHdAxUXyjEyNl2AFJalLuKSeOwBZHaMC376Hjxx4Efl3SATdZnmAoRu agag== 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=QmksWe7tRF2CUX6j+yZoGk06d70fuGnvZ6NC9ZABR0w=; b=b6vOarKxf4t7isZkhHiKtkQfALSJ2lck3bkc4m/3njOM+fYn6odgopRJ4bL+x5kMVs Fk6AgXXLWEUHIdPt7DTbTflgGGTlBo1vDi+WvnFy1Bwr2mZiOVnoZeIxfeFi6I+Yty16 hNztB3cplz70E11uAgxdzf26mwJ6q3Lg+qMTLTTR9KdorMsCWqX5Ft+DniawLgOfxhsH OjOxWsicvxJg1hsqivWeiPxN3WFuW4s1TXhaWI/9l47t3LYy8RtRCSWIZYvGTmstTR7Z 2QYQWJp07MYaqeo+0L/zQfN33QRfFwtJnnH5SjKkEje/7EUFjPUEtXOAgV0gFpD5UWsh R46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bPAun3c8; 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 m3si27206378pfh.58.2019.01.02.07.02.49; Wed, 02 Jan 2019 07:02:49 -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=bPAun3c8; 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 S1729818AbfABPCr (ORCPT + 31 others); Wed, 2 Jan 2019 10:02:47 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45568 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729209AbfABPCo (ORCPT ); Wed, 2 Jan 2019 10:02:44 -0500 Received: by mail-pg1-f196.google.com with SMTP id y4so14682097pgc.12 for ; Wed, 02 Jan 2019 07:02:43 -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=QmksWe7tRF2CUX6j+yZoGk06d70fuGnvZ6NC9ZABR0w=; b=bPAun3c8Gmb8PdHv/+odBQPHl5b7KisG7WhS5E+57mj+iDKDVo7bfNCpbIFkDzA/ri 7VMf3jjQCklQoA+ZUcYoG8YCdt6niX90jIDCfjknszfPWWx+WmySMIPhJq9XrJd5HvSO yd1RXS52bwsblnE9zgWMpQUN83xbS0jPC5hKA= 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=QmksWe7tRF2CUX6j+yZoGk06d70fuGnvZ6NC9ZABR0w=; b=gIxaMqvy3JcpM7awPtHiIV6t+9vTgbUFJUypSwpgaATr4g2IPk+V/gL6RvJpIwPPpA mxCJl8Wyhe5Eu93+lEuksgKIJplixuInKROrPtQ7Z07UozlwIHBKUDBnt8OYeAFwb8LL 2Zj6mAwEZrOyCktoJL7qDsiDxRqAmkRs4n3Xxc268qFwPeg9D1oMaYFvX6FR+kL59i2N fbTgglxDFpefAq84Jm9LxXyJn/yBlXbXV9VubbpaNeJsmV8mf67mRhucXLY1LbzJLnR/ F5ZdDh3bqb+9FBqbPmnkBVYdqIssTBAbfAseWSj5Uu1x+m//0dR1VUIt++IAIwf8OMrm ibDg== X-Gm-Message-State: AA+aEWZwP3YAZ0Lzu+pvFoET50TZPRaPRizTiRqIQ204LqSQVL0PuIG/ 70oX1unHYTbiMnAFtony1KG2ng== X-Received: by 2002:a62:4851:: with SMTP id v78mr45164684pfa.97.1546441363337; Wed, 02 Jan 2019 07:02:43 -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 z14sm66180213pgv.47.2019.01.02.07.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:02:42 -0800 (PST) From: Firoz Khan To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Al Viro , linuxppc-dev@lists.ozlabs.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] powerpc: generate uapi header and system call table files Date: Wed, 2 Jan 2019 20:32:04 +0530 Message-Id: <1546441324-19774-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546441324-19774-1-git-send-email-firoz.khan@linaro.org> References: <1546441324-19774-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/spu.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/spu.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/systbl.S file. Signed-off-by: Firoz Khan --- arch/powerpc/kernel/syscalls/Makefile | 11 +++++++-- arch/powerpc/kernel/syscalls/syscallhdr.sh | 37 ------------------------------ arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 ----------------------------- 3 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 arch/powerpc/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh -- 1.9.1 diff --git a/arch/powerpc/kernel/syscalls/Makefile b/arch/powerpc/kernel/syscalls/Makefile index 27b4895..5cbbd70 100644 --- a/arch/powerpc/kernel/syscalls/Makefile +++ b/arch/powerpc/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/powerpc/kernel/syscalls/syscallhdr.sh b/arch/powerpc/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index c0a9a32..0000000 --- a/arch/powerpc/kernel/syscalls/syscallhdr.sh +++ /dev/null @@ -1,37 +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_POWERPC_`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}" - printf "\n" -) > "$out" diff --git a/arch/powerpc/kernel/syscalls/syscalltbl.sh b/arch/powerpc/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index f7393a7..0000000 --- a/arch/powerpc/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"