From patchwork Wed Jan 2 15:06:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 154654 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp272832ljp; Wed, 2 Jan 2019 07:07:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN7NAr5Hz01b12GbVYgS0YxYQlmRqKfBzk7+OTE7e89raA3WVwdbJEf30ekv0tU151k3bvwF X-Received: by 2002:a63:e156:: with SMTP id h22mr13890572pgk.255.1546441656473; Wed, 02 Jan 2019 07:07:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546441656; cv=none; d=google.com; s=arc-20160816; b=Rut/FSmqgihzYxGv0Qr9gT197WPqLEv9Zguup2CZDmBYcXGU5XZA5xTUJroqUoQ1ht oNdjk1e1i2c58L2LeRIbkYi6m2Gk0deENrZ8phE8Y43jOpUFks//ClBySgLzUOBaY8XJ eo6N0jk3jvztqjzpNVtCmqe3+RQIgfF4IH4KveVxaqscLJxUG45O1T3iQmqOW+PSOrbM jl/w4atj19HnvCRs2v8HaR4//M+HbCv9uwh4F6h9RznNMXkjHENG3zWs5PBUUwMzP0Wi bwOWh9BV1p1j3ugzS44WwE6nv81Dc/uSui4JDQ4/wVXsggh6T+K37RdQksgvtTORHtXF y2xw== 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=5pdMpbxZGK+s8fSlT5tV/nT+dUGixWoP67cof2b1tuA=; b=lWF0s9/TNYd6QV6penj1oaamOxjICD+ZvaqZXRdP5qEqfctWhp6sQhrA8eTDYgX9pU TPcwpSnhT0zx5nvWxWQr5nW305p93Bd0j/7K/UMVSmBZ024esOpgfsdqJiIGXvSTrYUi 5GGm4agxhMC6S8nFAimQ+o3NQJYoGrxM9p73DYBfQ0wwNu+1rWKDgjv2fuSxv5a/IL69 5mD8De/2vuyvpp6/CJnha0E7zXib3wj/PnUtK3+9FwHIq+XwRPgm1j5fFR5a7xZH+fhd kaASsVtNEkf3pNXop83JH4BHbJfeDZyNnfDM/vpgmiPhS7B4Fnuoi+WSrSBGKdH+l18G zW2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C3xilImm; 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 19si48848241pgq.215.2019.01.02.07.07.35; Wed, 02 Jan 2019 07:07:36 -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=C3xilImm; 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 S1729891AbfABPHe (ORCPT + 31 others); Wed, 2 Jan 2019 10:07:34 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33267 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729851AbfABPHd (ORCPT ); Wed, 2 Jan 2019 10:07:33 -0500 Received: by mail-pf1-f194.google.com with SMTP id c123so15304760pfb.0 for ; Wed, 02 Jan 2019 07:07:32 -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=5pdMpbxZGK+s8fSlT5tV/nT+dUGixWoP67cof2b1tuA=; b=C3xilImm3AZ9AldnGA33ikZkxfXMu8bfiTh78/5/A+86KBaSCSmkP9IvH/CjkDEdRr H7dVCnSpjZW8RuvXWkhHed07eCXvQNuhpj3Om3yufMQ4S8T3Zd4ovIWKXi4hljPHSluR ZBH1jI0rBCyBN5J57iz/tSey9Mb+JoiMqN2Gs= 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=5pdMpbxZGK+s8fSlT5tV/nT+dUGixWoP67cof2b1tuA=; b=TXrPXE/r1piek6sa2/fig5xlsuoWhKCb5vVqUKeZdCXuw35CtGrv5RwJ0qu9AyreZ/ 5wnpRnntyLhACt/tQs6zBKnXCrK4rva6rkd2TNagmChG5cVLFmvJeGbkQY/WTiXBi3Pv b7pxRpZXE2ReT6aEO7fkf1IDGFdSsVv16Gzq8hIRATExabVeno3G9Z253GFxXIEDfAHG luVOe6HSx60MUGPCK0yaG+W0Lh2BcjBDq4Lh/WTdq4nyp82ZW1sdw/nxxjMxVC4T/gWx Pm9Z6XrvlaMkx4JUmQoOnGMoAHB2lnpGPPqmUAhkXw1416xDKLtoRj8+oQjKqeUAnS4K OJ9A== X-Gm-Message-State: AJcUukdyAmbQtlWQIikrAA3R2OmS05mAn/+LN3oNb92h7GQ7YBmx+oLf 06D0cCp+xJKHCb5y2BGNC0WbNQ== X-Received: by 2002:a62:824c:: with SMTP id w73mr44529975pfd.150.1546441651935; Wed, 02 Jan 2019 07:07:31 -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 k24sm78458985pfj.13.2019.01.02.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:07:31 -0800 (PST) From: Firoz Khan To: Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org, Al Viro , 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 1/2] alpha: remove nargs from __SYSCALL Date: Wed, 2 Jan 2019 20:36:58 +0530 Message-Id: <1546441619-19977-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546441619-19977-1-git-send-email-firoz.khan@linaro.org> References: <1546441619-19977-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 The __SYSCALL macro's arguments are system call number, system call entry name and number of arguments for the system call. Argument- nargs in __SYSCALL(nr, entry, nargs) is neither calculated nor used anywhere. So it would be better to keep the implementaion as __SYSCALL(nr, entry). This will unifies the implementation with some other architetures too. Signed-off-by: Firoz Khan --- arch/alpha/kernel/syscalls/syscalltbl.sh | 4 ++-- arch/alpha/kernel/systbls.S | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/alpha/kernel/syscalls/syscalltbl.sh b/arch/alpha/kernel/syscalls/syscalltbl.sh index 85d78d9..904b8e6 100644 --- a/arch/alpha/kernel/syscalls/syscalltbl.sh +++ b/arch/alpha/kernel/syscalls/syscalltbl.sh @@ -13,10 +13,10 @@ emit() { t_entry="$3" while [ $t_nxt -lt $t_nr ]; do - printf "__SYSCALL(%s, sys_ni_syscall, )\n" "${t_nxt}" + printf "__SYSCALL(%s,sys_ni_syscall)\n" "${t_nxt}" t_nxt=$((t_nxt+1)) done - printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}" + printf "__SYSCALL(%s,%s)\n" "${t_nxt}" "${t_entry}" } grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index 9704f22..36c94c8 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S @@ -7,7 +7,7 @@ #include -#define __SYSCALL(nr, entry, nargs) .quad entry +#define __SYSCALL(nr, entry) .quad entry .data .align 3 .globl sys_call_table From patchwork Wed Jan 2 15:06:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 154655 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp272953ljp; Wed, 2 Jan 2019 07:07:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VWwfyqfJ1SSBwNX5LTAqimk0ikw7vUiQwXCNL/t1Ytz2eVPdEEL7qSQKpnbdPkR6IA6xOq X-Received: by 2002:aa7:81d0:: with SMTP id c16mr44414042pfn.153.1546441663664; Wed, 02 Jan 2019 07:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546441663; cv=none; d=google.com; s=arc-20160816; b=ShaiolyHx9rDIKSftv8lh5Oz/BJSkOICk2rpw3Nbt3bWGTlPpFEVLtZB2PBbram8tH dVlF8vguZ/YLAIimbucAEYwrw4FmoFquzJp4231zK6lpNdy7S3+SdsvPGIiwq6DpNox7 H2Bde2jHXXIlkgV+qovGT58ra2kMWMiDesq4O8D4PB19Sw4o3LNnNr39H/KrTpgoHIrY XLXgMW4JOBwcn7wAvst6nFl3uZv0OVvyiFPaSXsjNi8ij9HnAlCdmFR0H9OB9L8zEuwT 1DTkzTsvNP4w7iWw72hiiTL2qzesfDzkDTY10WqMUIk+hQwqlEAsWOvygnAkls16Xlcu 11Cg== 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=BpdCkO4cmTj33UUTHGwsT4WjRV/iOfWi6Qr7bUc27sE=; b=lckEV3xAsBfvzZXB15BSC3Zt6+BsLrQ0BPBUfj3LJWxGwafgu+YFA8EkEFsEKy2VsX 3V7iWzN18ukNrhPyCyh9lGeZu0ssULogM6a7RvrRp0QsFAhpa/T1HsmcWXUmqeJUMNqM RE1bGdKeFcLV7K3qjbGaDkX8jAmdKzH0Sqk7mu7hovl4NsWCrKOuj8W2GaZj7svAPFIz KZl/UFSZZbSmT0o6RyurKoy/MZ2NZ3z68jT4ZfGJAZDR/iQ1Q92D3O93wnr5be2FMV39 FoDsfUk+29n+hqV2rD+pMPTvwrFYz+vLI1SR5A0/z+dVrH37aIx5mxPxxpSGWMTFt6p2 3osQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GIitmsin; 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 19si48848241pgq.215.2019.01.02.07.07.43; Wed, 02 Jan 2019 07:07:43 -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=GIitmsin; 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 S1729916AbfABPHm (ORCPT + 31 others); Wed, 2 Jan 2019 10:07:42 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45899 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729853AbfABPHi (ORCPT ); Wed, 2 Jan 2019 10:07:38 -0500 Received: by mail-pg1-f194.google.com with SMTP id y4so14687276pgc.12 for ; Wed, 02 Jan 2019 07:07: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=BpdCkO4cmTj33UUTHGwsT4WjRV/iOfWi6Qr7bUc27sE=; b=GIitmsins5R8uwRYvO3WlhKg4IdAIReu53iCAMsOG4VxX0NVX3TOc6UD/biqn82mGp 6EXh1luvYHJuToJk8c7rtEQJZM9TUko99GkxocDxSFM/Dbp1wUkbCdzJ/RnPmB8oxlgr fRao6BOBqtoiBa1UEIztlLbH06nFTuCV7He5s= 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=BpdCkO4cmTj33UUTHGwsT4WjRV/iOfWi6Qr7bUc27sE=; b=JWWFVo3tz2/jw0yKIK1nWiLmMxjtQnrdojynk0Jwss9w3KcgkLrzxyPnTS2Yw1NgTC U0NNYl01rLqYL9Vb/gasOqhaOCGJaRT43+5uWY/urYXVLz4TjeJPufBb8dgzwFuQ3ej5 IjfpL3zje8EXzr9Iin5K2vuaZ1i7IOJIjZolBkHTXfD98oma27zfZSaeHQ7OFQJtZULG Mf7GXeiJgXEHFxX1DdXDh1BFE+q+FzADDmGuRzfLF22JC+bBU6fHygCh06oCfMUnO2aS 0nyunKLwQCJ2/ev0tJrIj7+m+nyKCgHIQJbH4sj7QVoGYpB3nvby3p3ri1WKV5R5VsGa Ov0Q== X-Gm-Message-State: AA+aEWZYqDYZyyVSBX89Q8QQ5rns87uith95uO6vXjq5sb2chf+lhbef cLFDFExrzK5XvSfnDZzW4hnGzg== X-Received: by 2002:a62:d148:: with SMTP id t8mr45871258pfl.52.1546441657161; Wed, 02 Jan 2019 07:07: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 k24sm78458985pfj.13.2019.01.02.07.07.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 07:07:36 -0800 (PST) From: Firoz Khan To: Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org, Al Viro , 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] alpha: generate uapi header and syscall table header files Date: Wed, 2 Jan 2019 20:36:59 +0530 Message-Id: <1546441619-19977-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546441619-19977-1-git-send-email-firoz.khan@linaro.org> References: <1546441619-19977-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 alpha/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.S file. Signed-off-by: Firoz Khan --- arch/alpha/kernel/syscalls/Makefile | 11 ++++++++-- arch/alpha/kernel/syscalls/syscallhdr.sh | 36 -------------------------------- arch/alpha/kernel/syscalls/syscalltbl.sh | 32 ---------------------------- 3 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 arch/alpha/kernel/syscalls/syscallhdr.sh delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh -- 1.9.1 diff --git a/arch/alpha/kernel/syscalls/Makefile b/arch/alpha/kernel/syscalls/Makefile index 659faef..75c7421 100644 --- a/arch/alpha/kernel/syscalls/Makefile +++ b/arch/alpha/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/alpha/kernel/syscalls/syscallhdr.sh b/arch/alpha/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index e5b99bd..0000000 --- a/arch/alpha/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_ALPHA_`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/alpha/kernel/syscalls/syscalltbl.sh b/arch/alpha/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index 904b8e6..0000000 --- a/arch/alpha/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"