Skip to content

Commit

Permalink
x86/entry: Remove ABI prefixes from functions in syscall tables
Browse files Browse the repository at this point in the history
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 <brgerst@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200313195144.164260-13-brgerst@gmail.com
  • Loading branch information
Brian Gerst authored and Thomas Gleixner committed Mar 21, 2020
1 parent 8210efc commit cab56d3
Show file tree
Hide file tree
Showing 6 changed files with 791 additions and 799 deletions.
6 changes: 5 additions & 1 deletion arch/x86/entry/syscall_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

#ifdef CONFIG_IA32_EMULATION
#define __SYSCALL_I386(nr, sym) [nr] = __ia32_##sym,
#else /* CONFIG_IA32_EMULATION */
#define __SYSCALL_I386(nr, sym) [nr] = sym,
#endif /* CONFIG_IA32_EMULATION */

__visible const sys_call_ptr_t ia32_sys_call_table[__NR_ia32_syscall_max+1] = {
/*
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/entry/syscall_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#define __SYSCALL_X32(nr, sym)
#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym)

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

#define __SYSCALL_64(nr, sym) [nr] = sym,
#define __SYSCALL_64(nr, sym) [nr] = __x64_##sym,

asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
/*
Expand Down
8 changes: 4 additions & 4 deletions arch/x86/entry/syscall_x32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

#define __SYSCALL_64(nr, sym)

#define __SYSCALL_X32(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long sym(const struct pt_regs *);
#define __SYSCALL_X32(nr, sym) extern asmlinkage long __x32_##sym(const struct pt_regs *);
#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *);
#include <asm/syscalls_64.h>
#undef __SYSCALL_X32
#undef __SYSCALL_COMMON

#define __SYSCALL_X32(nr, sym) [nr] = sym,
#define __SYSCALL_COMMON(nr, sym) [nr] = sym,
#define __SYSCALL_X32(nr, sym) [nr] = __x32_##sym,
#define __SYSCALL_COMMON(nr, sym) [nr] = __x64_##sym,

asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = {
/*
Expand Down
Loading

0 comments on commit cab56d3

Please sign in to comment.