Skip to content

Commit cab56d3

Browse files
Brian GerstKAGA-KOKO
authored andcommitted
x86/entry: Remove ABI prefixes from functions in syscall tables
Move the ABI prefixes to the __SYSCALL_[abi]() macros. This allows removal of the need to strip the prefix for UML. Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8210efc commit cab56d3

File tree

6 files changed

+791
-799
lines changed

6 files changed

+791
-799
lines changed

arch/x86/entry/syscall_32.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#ifdef CONFIG_IA32_EMULATION
1111
/* On X86_64, we use struct pt_regs * to pass parameters to syscalls */
12-
#define __SYSCALL_I386(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
12+
#define __SYSCALL_I386(nr, sym) extern asmlinkage long __ia32_##sym(const struct pt_regs *);
1313
#define __sys_ni_syscall __ia32_sys_ni_syscall
1414
#else /* CONFIG_IA32_EMULATION */
1515
#define __SYSCALL_I386(nr, sym) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
@@ -20,7 +20,11 @@ extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned lon
2020
#include <asm/syscalls_32.h>
2121
#undef __SYSCALL_I386
2222

23+
#ifdef CONFIG_IA32_EMULATION
24+
#define __SYSCALL_I386(nr, sym) [nr] = __ia32_##sym,
25+
#else /* CONFIG_IA32_EMULATION */
2326
#define __SYSCALL_I386(nr, sym) [nr] = sym,
27+
#endif /* CONFIG_IA32_EMULATION */
2428

2529
__visible const sys_call_ptr_t ia32_sys_call_table[__NR_ia32_syscall_max+1] = {
2630
/*

arch/x86/entry/syscall_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#define __SYSCALL_X32(nr, sym)
1212
#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym)
1313

14-
#define __SYSCALL_64(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
14+
#define __SYSCALL_64(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *);
1515
#include <asm/syscalls_64.h>
1616
#undef __SYSCALL_64
1717

18-
#define __SYSCALL_64(nr, sym) [nr] = sym,
18+
#define __SYSCALL_64(nr, sym) [nr] = __x64_##sym,
1919

2020
asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
2121
/*

arch/x86/entry/syscall_x32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
#define __SYSCALL_64(nr, sym)
1212

13-
#define __SYSCALL_X32(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
14-
#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
13+
#define __SYSCALL_X32(nr, sym) extern asmlinkage long __x32_##sym(const struct pt_regs *);
14+
#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *);
1515
#include <asm/syscalls_64.h>
1616
#undef __SYSCALL_X32
1717
#undef __SYSCALL_COMMON
1818

19-
#define __SYSCALL_X32(nr, sym) [nr] = sym,
20-
#define __SYSCALL_COMMON(nr, sym) [nr] = sym,
19+
#define __SYSCALL_X32(nr, sym) [nr] = __x32_##sym,
20+
#define __SYSCALL_COMMON(nr, sym) [nr] = __x64_##sym,
2121

2222
asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = {
2323
/*

0 commit comments

Comments
 (0)