From patchwork Fri May 28 03:46:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12286145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 746AFC4707F for ; Fri, 28 May 2021 03:48:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4580E611AB for ; Fri, 28 May 2021 03:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233040AbhE1Dtt (ORCPT ); Thu, 27 May 2021 23:49:49 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:45874 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhE1Dtt (ORCPT ); Thu, 27 May 2021 23:49:49 -0400 Received: from localhost.localdomain (133-32-232-101.west.xps.vectant.ne.jp [133.32.232.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 14S3lbQR031425; Fri, 28 May 2021 12:47:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 14S3lbQR031425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1622173658; bh=BV0Xhzu11ytLpeCNoa7cH4BZNQYYRY20XqustzLMqtw=; h=From:To:Cc:Subject:Date:From; b=UDTQuIN7y8sRPPl4Jpoku4ALmYQznnc2oqzi3Xg80Z2JM3zZE5+zTUbbjESFHL3tX NxFjiPzqv7pxqPwNcB1nCECxtQ1kF2x/4K3d98topILkLSlSGPeMAKGDA2dCksW16L fP1SyXQbsl4PYyiNxQR6GehUwtui0NxAZd4PzjvDaFDxsEu79R3i9Av5UU358quZCI raa4UId+c37NCMbeaEfgQ+5Jd5E0JVYxHzp1fsibGugJEYgzZXeN5Al0sd9sb0ufqy SwHol4hDQHPRj3D32yC+o53DZT86ei/BQXMLnkN6IsT3vwfma//xlRDV8UnF3FWp6j 98fbENepqb53Q== X-Nifty-SrcIP: [133.32.232.101] From: Masahiro Yamada To: Thomas Bogendoerfer , linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Alexander Lobakin , Geert Uytterhoeven Subject: [PATCH 1/2] mips: syscalls: define syscall offsets directly in Date: Fri, 28 May 2021 12:46:14 +0900 Message-Id: <20210528034615.2157002-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org There is no good reason to generate the syscall offset macros by scripting since they are not derived from the syscall tables. Define __NR_*_Linux macros directly in arch/mips/include/asm/unistd.h, and clean up the Makefile and the shell script. Signed-off-by: Masahiro Yamada Reviewed-by: Philippe Mathieu-Daudé --- arch/mips/include/asm/unistd.h | 4 ++++ arch/mips/kernel/syscalls/Makefile | 6 +----- arch/mips/kernel/syscalls/syscallnr.sh | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 5d70babfc9ee..c2196b1b6604 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h @@ -17,6 +17,10 @@ #include #include +#define __NR_N32_Linux 6000 +#define __NR_64_Linux 5000 +#define __NR_O32_Linux 4000 + #ifdef CONFIG_MIPS32_N32 #define NR_syscalls (__NR_N32_Linux + __NR_N32_Linux_syscalls) #elif defined(CONFIG_64BIT) diff --git a/arch/mips/kernel/syscalls/Makefile b/arch/mips/kernel/syscalls/Makefile index 904452992992..6eee6a3b85df 100644 --- a/arch/mips/kernel/syscalls/Makefile +++ b/arch/mips/kernel/syscalls/Makefile @@ -18,8 +18,7 @@ quiet_cmd_syshdr = SYSHDR $@ quiet_cmd_sysnr = SYSNR $@ cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ '$(sysnr_abis_$(basetarget))' \ - '$(sysnr_pfx_$(basetarget))' \ - '$(sysnr_offset_$(basetarget))' + '$(sysnr_pfx_$(basetarget))' quiet_cmd_systbl = SYSTBL $@ cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@ @@ -34,17 +33,14 @@ $(uapi)/unistd_o32.h: $(syscallo32) $(syshdr) FORCE $(call if_changed,syshdr) sysnr_pfx_unistd_nr_n32 := N32 -sysnr_offset_unistd_nr_n32 := 6000 $(kapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr) FORCE $(call if_changed,sysnr) sysnr_pfx_unistd_nr_n64 := 64 -sysnr_offset_unistd_nr_n64 := 5000 $(kapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr) FORCE $(call if_changed,sysnr) sysnr_pfx_unistd_nr_o32 := O32 -sysnr_offset_unistd_nr_o32 := 4000 $(kapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr) FORCE $(call if_changed,sysnr) diff --git a/arch/mips/kernel/syscalls/syscallnr.sh b/arch/mips/kernel/syscalls/syscallnr.sh index 60bbdb3fe03a..c190bbefbfc2 100644 --- a/arch/mips/kernel/syscalls/syscallnr.sh +++ b/arch/mips/kernel/syscalls/syscallnr.sh @@ -5,7 +5,6 @@ in="$1" out="$2" my_abis=`echo "($3)" | tr ',' '|'` prefix="$4" -offset="$5" fileguard=_UAPI_ASM_MIPS_`basename "$out" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ @@ -20,7 +19,6 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( nxt=$((nr+1)) done - printf "#define __NR_%s_Linux\t%s\n" "${prefix}" "${offset}" printf "#define __NR_%s_Linux_syscalls\t%s\n" "${prefix}" "${nxt}" printf "\n" printf "#endif /* %s */" "${fileguard}" From patchwork Fri May 28 03:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12286147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A817C47087 for ; Fri, 28 May 2021 03:48:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 783C9611AB for ; Fri, 28 May 2021 03:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbhE1Dt5 (ORCPT ); Thu, 27 May 2021 23:49:57 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:46138 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234250AbhE1Dt5 (ORCPT ); Thu, 27 May 2021 23:49:57 -0400 Received: from localhost.localdomain (133-32-232-101.west.xps.vectant.ne.jp [133.32.232.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 14S3lbQS031425; Fri, 28 May 2021 12:47:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 14S3lbQS031425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1622173658; bh=ouG2b1fE1uCLF7gpYSY3y7RJx5hhaSNbq5IGxW6A6ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FfAuFSXgb76TIHDcybdPDVmr0g+A32vj5PPFxgtEGst/IK5p3PU6/NZODD0k7jUw/ EvT3PYf987Z0umL+lbjNToE9pf2xjpobOb4ggtBAm2D30DvZ2GrS/7Rp1icsnwPoQA qRVNU3zQrzopx47CgP2nU8SyZdHzMhyd/WQ5UhGruKtOHCSHTx2KdiwWtNaz7S7lcW yF3gTwwsBmN5H0+FGlmlzeFtqOf3jx/oLLT0AUJxoYLenX5CUImbVAtPxVeimm3mus 9ZrNJYnKm29abVnmI2zPi0t9qMUr4zn+KfwD1Vb95pA3SCoHDmHK5KqSjPk6Rv3dhf zJA6SShnKtT7g== X-Nifty-SrcIP: [133.32.232.101] From: Masahiro Yamada To: Thomas Bogendoerfer , linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Alexander Lobakin , Geert Uytterhoeven Subject: [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Date: Fri, 28 May 2021 12:46:15 +0900 Message-Id: <20210528034615.2157002-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210528034615.2157002-1-masahiroy@kernel.org> References: <20210528034615.2157002-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Use pattern rules to unify similar build rules among n32, n64, and o32. Signed-off-by: Masahiro Yamada --- arch/mips/kernel/syscalls/Makefile | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/arch/mips/kernel/syscalls/Makefile b/arch/mips/kernel/syscalls/Makefile index 6eee6a3b85df..10bf90dc02c0 100644 --- a/arch/mips/kernel/syscalls/Makefile +++ b/arch/mips/kernel/syscalls/Makefile @@ -5,9 +5,6 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') -syscalln32 := $(src)/syscall_n32.tbl -syscalln64 := $(src)/syscall_n64.tbl -syscallo32 := $(src)/syscall_o32.tbl syshdr := $(srctree)/scripts/syscallhdr.sh sysnr := $(srctree)/$(src)/syscallnr.sh systbl := $(srctree)/scripts/syscalltbl.sh @@ -23,34 +20,17 @@ quiet_cmd_sysnr = SYSNR $@ quiet_cmd_systbl = SYSTBL $@ cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@ -$(uapi)/unistd_n32.h: $(syscalln32) $(syshdr) FORCE - $(call if_changed,syshdr) - -$(uapi)/unistd_n64.h: $(syscalln64) $(syshdr) FORCE - $(call if_changed,syshdr) - -$(uapi)/unistd_o32.h: $(syscallo32) $(syshdr) FORCE +$(uapi)/unistd_%.h: $(src)/syscall_%.tbl $(syshdr) FORCE $(call if_changed,syshdr) sysnr_pfx_unistd_nr_n32 := N32 -$(kapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr) FORCE - $(call if_changed,sysnr) - sysnr_pfx_unistd_nr_n64 := 64 -$(kapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr) FORCE - $(call if_changed,sysnr) - sysnr_pfx_unistd_nr_o32 := O32 -$(kapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr) FORCE - $(call if_changed,sysnr) - -$(kapi)/syscall_table_n32.h: $(syscalln32) $(systbl) FORCE - $(call if_changed,systbl) -$(kapi)/syscall_table_n64.h: $(syscalln64) $(systbl) FORCE - $(call if_changed,systbl) +$(kapi)/unistd_nr_%.h: $(src)/syscall_%.tbl $(sysnr) FORCE + $(call if_changed,sysnr) -$(kapi)/syscall_table_o32.h: $(syscallo32) $(systbl) FORCE +$(kapi)/syscall_table_%.h: $(src)/syscall_%.tbl $(systbl) FORCE $(call if_changed,systbl) uapisyshdr-y += unistd_n32.h \