* [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h>
@ 2021-05-28 3:46 Masahiro Yamada
2021-05-28 3:46 ` [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Masahiro Yamada
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-05-28 3:46 UTC (permalink / raw)
To: Thomas Bogendoerfer, linux-mips
Cc: linux-kernel, Masahiro Yamada, Alexander Lobakin, Geert Uytterhoeven
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 <masahiroy@kernel.org>
---
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 <asm/unistd_nr_n64.h>
#include <asm/unistd_nr_o32.h>
+#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}"
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers
2021-05-28 3:46 [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Masahiro Yamada
@ 2021-05-28 3:46 ` Masahiro Yamada
2021-06-01 9:48 ` Thomas Bogendoerfer
2021-05-28 13:47 ` [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Philippe Mathieu-Daudé
2021-06-01 9:47 ` Thomas Bogendoerfer
2 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-05-28 3:46 UTC (permalink / raw)
To: Thomas Bogendoerfer, linux-mips
Cc: linux-kernel, Masahiro Yamada, Alexander Lobakin, Geert Uytterhoeven
Use pattern rules to unify similar build rules among n32, n64, and o32.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
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 \
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h>
2021-05-28 3:46 [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Masahiro Yamada
2021-05-28 3:46 ` [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Masahiro Yamada
@ 2021-05-28 13:47 ` Philippe Mathieu-Daudé
2021-06-01 9:47 ` Thomas Bogendoerfer
2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-28 13:47 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Thomas Bogendoerfer, open list:BROADCOM NVRAM DRIVER, open list,
Alexander Lobakin, Geert Uytterhoeven
On Fri, May 28, 2021 at 8:11 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 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 <masahiroy@kernel.org>
> ---
>
> 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(-)
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h>
2021-05-28 3:46 [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Masahiro Yamada
2021-05-28 3:46 ` [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Masahiro Yamada
2021-05-28 13:47 ` [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Philippe Mathieu-Daudé
@ 2021-06-01 9:47 ` Thomas Bogendoerfer
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Bogendoerfer @ 2021-06-01 9:47 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-mips, linux-kernel, Alexander Lobakin, Geert Uytterhoeven
On Fri, May 28, 2021 at 12:46:14PM +0900, Masahiro Yamada wrote:
> 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 <masahiroy@kernel.org>
> ---
>
> 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(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers
2021-05-28 3:46 ` [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Masahiro Yamada
@ 2021-06-01 9:48 ` Thomas Bogendoerfer
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Bogendoerfer @ 2021-06-01 9:48 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-mips, linux-kernel, Alexander Lobakin, Geert Uytterhoeven
On Fri, May 28, 2021 at 12:46:15PM +0900, Masahiro Yamada wrote:
> Use pattern rules to unify similar build rules among n32, n64, and o32.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> arch/mips/kernel/syscalls/Makefile | 28 ++++------------------------
> 1 file changed, 4 insertions(+), 24 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-01 9:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 3:46 [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Masahiro Yamada
2021-05-28 3:46 ` [PATCH 2/2] mips: syscalls: use pattern rules to generate syscall headers Masahiro Yamada
2021-06-01 9:48 ` Thomas Bogendoerfer
2021-05-28 13:47 ` [PATCH 1/2] mips: syscalls: define syscall offsets directly in <asm/unistd.h> Philippe Mathieu-Daudé
2021-06-01 9:47 ` Thomas Bogendoerfer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.