From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: convert to generated system call tables
Date: Wed, 19 Oct 2016 17:30:49 +0200 [thread overview]
Message-ID: <13702107.LdHY4HTXyY@wuerfel> (raw)
In-Reply-To: <E1bwa6s-0004ZY-4k@rmk-PC.armlinux.org.uk>
On Tuesday, October 18, 2016 8:31:38 PM CEST Russell King wrote:
> Convert ARM to use a similar mechanism to x86 to generate the unistd.h
> system call numbers and the various kernel system call tables. This
> means that rather than having to edit three places (asm/unistd.h for
> the total number of system calls, uapi/asm/unistd.h for the system call
> numbers, and arch/arm/kernel/calls.S for the call table) we have only
> one place to edit, making the process much more simple.
>
> The scripts have knowledge of the table padding requirements, so there's
> no need to worry about __NR_syscalls not fitting within the immediate
> constant field of ALU instructions anymore.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Ah, very nice!
I have some vague plans to do something like this for all architectures,
so having it done for one of the more complex examples (there are very
few architectures with more than one table) simplifies it a lot.
The next step is probably to do it for asm-generic/unistd.h, which
covers a lot of architectures, and then we can introduce a shared
table for all future additions so we only have to add the new calls
in one place, and change the scripts so they can merge two input
files into one.
> diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl
> new file mode 100644
> index 000000000000..62285cbd09c0
> --- /dev/null
> +++ b/arch/arm/tools/syscall.tbl
> @@ -0,0 +1,428 @@
> +#
> +# Linux system call numbers and entry vectors
> +#
> +# The format is:
> +# <num> <abi> <name> <entry point> <oabi compat entry point>
> +#
> +# Where abi is:
> +# common - for system calls shared between oabi and eabi
> +# oabi - for oabi-only system calls (may have compat)
> +# eabi - for eabi-only system calls
Why do we need all three? I would have guessed that these two are
sufficient to cover all cases:
arm - one entry for eabi, optional second entry for oabi if different
oabi - only one entry for oabi, syscall is not used on eabi
> +180 oabi pread64 sys_pread64 sys_oabi_pread64
> +180 eabi pread64 sys_pread64
> +181 oabi pwrite64 sys_pwrite64 sys_oabi_pwrite64
> +181 eabi pwrite64 sys_pwrite64
That would avoid having to list those numbers twice, which looks
a bit odd here, and is inconsistent with how x86 handles their
compat table for x32
> diff --git a/arch/arm/tools/syscallhdr.sh b/arch/arm/tools/syscallhdr.sh
> new file mode 100644
> index 000000000000..72d4b2e3bdec
> --- /dev/null
> +++ b/arch/arm/tools/syscallhdr.sh
The scripts are still very similar to the x86 version. Any chance
we can move them to a top-level scripts/syscall/ directory and make
them work for both architectures? It would be good to avoid duplicating
them for all the other architectures too, so starting out with a common
version could make that easier.
If necessary, I can do that once I get to the following stage of
doing the asm-generic/unistd.h replacement.
Arnd
next prev parent reply other threads:[~2016-10-19 15:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 19:31 [PATCH 2/3] ARM: convert to generated system call tables Russell King
2016-10-19 15:30 ` Arnd Bergmann [this message]
2016-10-19 15:53 ` Russell King - ARM Linux
2016-10-21 13:06 ` Arnd Bergmann
2016-10-21 13:37 ` Russell King - ARM Linux
2016-10-21 15:18 ` Arnd Bergmann
2016-10-21 15:48 ` Russell King - ARM Linux
2016-10-21 16:48 ` Joseph Myers
2016-10-21 16:57 ` Russell King - ARM Linux
2016-10-21 20:35 ` Arnd Bergmann
2016-10-22 20:23 ` Robert Jarzmik
2016-10-24 9:25 ` Geert Uytterhoeven
2016-10-26 20:14 ` Robert Jarzmik
2016-10-24 9:29 ` Geert Uytterhoeven
2016-10-25 9:12 ` Michael Cree
2016-10-25 10:28 ` Arnd Bergmann
2016-10-25 17:03 ` Richard Henderson
2016-10-25 17:09 ` Geert Uytterhoeven
2016-10-26 7:04 ` Michael Cree
2016-10-26 9:12 ` bpf on Alpha [was Re: [PATCH 2/3] ARM: convert to generated system call tables] Michael Cree
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13702107.LdHY4HTXyY@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox