Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 36d69c2

Browse files
committed
hexagon: use new system call table
The uapi/asm/unistd_32.h and asm/syscall_table_32.h headers can now be generated from scripts/syscall.tbl, which makes this consistent with the other architectures that have their own syscall.tbl. The time32, stat64, rlimit and renameat entries in the syscall_abis_32 line are for system calls that were part of the generic ABI when arch/hexagon got added but are no longer enabled by default for new architectures. As a side-effect, calling an unimplemented syscall now return -ENOSYS rather than branching into a NULL pointer. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent f840cab commit 36d69c2

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

arch/hexagon/include/asm/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += syscall_table_32.h
3+
24
generic-y += extable.h
35
generic-y += iomap.h
46
generic-y += kvm_para.h

arch/hexagon/include/asm/unistd.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
3+
#define __ARCH_WANT_STAT64
4+
#define __ARCH_WANT_SYS_CLONE
5+
#define __ARCH_WANT_SYS_VFORK
6+
#define __ARCH_WANT_SYS_FORK
7+
8+
#define __ARCH_BROKEN_SYS_CLONE3
9+
10+
#include <uapi/asm/unistd.h>

arch/hexagon/include/uapi/asm/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += unistd_32.h
3+
24
generic-y += ucontext.h

arch/hexagon/include/uapi/asm/unistd.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@
2727
* See also: syscalltab.c
2828
*/
2929

30-
#define sys_mmap2 sys_mmap_pgoff
31-
#define __ARCH_WANT_RENAMEAT
32-
#define __ARCH_WANT_STAT64
33-
#define __ARCH_WANT_SET_GET_RLIMIT
34-
#define __ARCH_WANT_SYS_EXECVE
35-
#define __ARCH_WANT_SYS_CLONE
36-
#define __ARCH_WANT_SYS_VFORK
37-
#define __ARCH_WANT_SYS_FORK
38-
#define __ARCH_WANT_TIME32_SYSCALLS
39-
#define __ARCH_WANT_SYNC_FILE_RANGE2
30+
#include <asm/unistd_32.h>
4031

41-
#define __ARCH_BROKEN_SYS_CLONE3
42-
43-
#include <asm-generic/unistd.h>
32+
#define __NR_sync_file_range2 84
33+
#undef __NR_sync_file_range

arch/hexagon/kernel/Makefile.syscalls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
syscall_abis_32 += hexagon time32 stat64 rlimit renameat

arch/hexagon/kernel/syscalltab.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
#include <asm/syscall.h>
1313

14-
#undef __SYSCALL
1514
#define __SYSCALL(nr, call) [nr] = (call),
15+
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
16+
17+
#define sys_mmap2 sys_mmap_pgoff
1618

1719
SYSCALL_DEFINE6(hexagon_fadvise64_64, int, fd, int, advice,
1820
SC_ARG64(offset), SC_ARG64(len))
@@ -21,6 +23,8 @@ SYSCALL_DEFINE6(hexagon_fadvise64_64, int, fd, int, advice,
2123
}
2224
#define sys_fadvise64_64 sys_hexagon_fadvise64_64
2325

26+
#define sys_sync_file_range sys_sync_file_range2
27+
2428
void *sys_call_table[__NR_syscalls] = {
25-
#include <asm/unistd.h>
29+
#include <asm/syscall_table_32.h>
2630
};

0 commit comments

Comments
 (0)