Commit cab56d34 authored by Brian Gerst's avatar Brian Gerst Committed by Thomas Gleixner

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: default avatarBrian Gerst <brgerst@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200313195144.164260-13-brgerst@gmail.com
parent 8210efcb
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifdef CONFIG_IA32_EMULATION #ifdef CONFIG_IA32_EMULATION
/* On X86_64, we use struct pt_regs * to pass parameters to syscalls */ /* 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 #define __sys_ni_syscall __ia32_sys_ni_syscall
#else /* CONFIG_IA32_EMULATION */ #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); #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 ...@@ -20,7 +20,11 @@ extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned lon
#include <asm/syscalls_32.h> #include <asm/syscalls_32.h>
#undef __SYSCALL_I386 #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, #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] = { __visible const sys_call_ptr_t ia32_sys_call_table[__NR_ia32_syscall_max+1] = {
/* /*
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#define __SYSCALL_X32(nr, sym) #define __SYSCALL_X32(nr, sym)
#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(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> #include <asm/syscalls_64.h>
#undef __SYSCALL_64 #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] = { asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
/* /*
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
#define __SYSCALL_64(nr, sym) #define __SYSCALL_64(nr, sym)
#define __SYSCALL_X32(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 sym(const struct pt_regs *); #define __SYSCALL_COMMON(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *);
#include <asm/syscalls_64.h> #include <asm/syscalls_64.h>
#undef __SYSCALL_X32 #undef __SYSCALL_X32
#undef __SYSCALL_COMMON #undef __SYSCALL_COMMON
#define __SYSCALL_X32(nr, sym) [nr] = sym, #define __SYSCALL_X32(nr, sym) [nr] = __x32_##sym,
#define __SYSCALL_COMMON(nr, sym) [nr] = sym, #define __SYSCALL_COMMON(nr, sym) [nr] = __x64_##sym,
asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = { asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = {
/* /*
......
This diff is collapsed.
This diff is collapsed.
...@@ -17,27 +17,15 @@ emit() { ...@@ -17,27 +17,15 @@ emit() {
local nr="$2" local nr="$2"
local entry="$3" local entry="$3"
local compat="$4" local compat="$4"
local umlentry=""
if [ "$abi" != "I386" -a -n "$compat" ]; then if [ "$abi" != "I386" -a -n "$compat" ]; then
echo "a compat entry ($abi: $compat) for a 64-bit syscall makes no sense" >&2 echo "a compat entry ($abi: $compat) for a 64-bit syscall makes no sense" >&2
exit 1 exit 1
fi fi
# For CONFIG_UML, we need to strip the __x64_sys prefix
if [ "${entry}" != "${entry#__x64_sys}" ]; then
umlentry="sys${entry#__x64_sys}"
fi
if [ -z "$compat" ]; then if [ -z "$compat" ]; then
if [ -n "$entry" -a -z "$umlentry" ]; then if [ -n "$entry" ]; then
syscall_macro "$abi" "$nr" "$entry"
elif [ -n "$umlentry" ]; then # implies -n "$entry"
echo "#ifdef CONFIG_X86"
syscall_macro "$abi" "$nr" "$entry" syscall_macro "$abi" "$nr" "$entry"
echo "#else /* CONFIG_UML */"
syscall_macro "$abi" "$nr" "$umlentry"
echo "#endif"
fi fi
else else
echo "#ifdef CONFIG_X86_32" echo "#ifdef CONFIG_X86_32"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment