Skip to content

Commit

Permalink
ARM: convert to generated system call tables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Oct 18, 2016
1 parent 4e2648d commit 96a8fae
Show file tree
Hide file tree
Showing 12 changed files with 625 additions and 873 deletions.
3 changes: 3 additions & 0 deletions arch/arm/Makefile
Expand Up @@ -311,6 +311,9 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)

boot := arch/arm/boot

archheaders:
$(Q)$(MAKE) $(build)=arch/arm/tools uapi

archprepare:
$(Q)$(MAKE) $(build)=arch/arm/tools kapi

Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/Kbuild
Expand Up @@ -41,3 +41,4 @@ generic-y += trace_clock.h
generic-y += unaligned.h

generated-y += mach-types.h
generated-y += unistd-nr.h
26 changes: 20 additions & 6 deletions arch/arm/include/asm/unistd.h
Expand Up @@ -14,12 +14,7 @@
#define __ASM_ARM_UNISTD_H

#include <uapi/asm/unistd.h>

/*
* This may need to be greater than __NR_last_syscall+1 in order to
* account for the padding in the syscall table
*/
#define __NR_syscalls (396)
#include <asm/unistd-nr.h>

#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME
Expand Down Expand Up @@ -52,4 +47,23 @@
#define __IGNORE_fadvise64_64
#define __IGNORE_migrate_pages

#ifdef __ARM_EABI__
/*
* The following syscalls are obsolete and no longer available for EABI:
* __NR_time
* __NR_umount
* __NR_stime
* __NR_alarm
* __NR_utime
* __NR_getrlimit
* __NR_select
* __NR_readdir
* __NR_mmap
* __NR_socketcall
* __NR_syscall
* __NR_ipc
*/
#define __IGNORE_getrlimit
#endif

#endif /* __ASM_ARM_UNISTD_H */
3 changes: 3 additions & 0 deletions arch/arm/include/uapi/asm/Kbuild
Expand Up @@ -18,3 +18,6 @@ header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += unistd.h
genhdr-y += unistd-common.h
genhdr-y += unistd-oabi.h
genhdr-y += unistd-eabi.h

0 comments on commit 96a8fae

Please sign in to comment.