mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
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 <brgerst@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200313195144.164260-13-brgerst@gmail.com
This commit is contained in:
committed by
Thomas Gleixner
parent
8210efcb15
commit
cab56d3484
@@ -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);
|
||||
@@ -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] = {
|
||||
/*
|
||||
|
||||
@@ -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] = {
|
||||
/*
|
||||
|
||||
@@ -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] = {
|
||||
/*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -17,27 +17,15 @@ emit() {
|
||||
local nr="$2"
|
||||
local entry="$3"
|
||||
local compat="$4"
|
||||
local umlentry=""
|
||||
|
||||
if [ "$abi" != "I386" -a -n "$compat" ]; then
|
||||
echo "a compat entry ($abi: $compat) for a 64-bit syscall makes no sense" >&2
|
||||
exit 1
|
||||
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 [ -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"
|
||||
echo "#else /* CONFIG_UML */"
|
||||
syscall_macro "$abi" "$nr" "$umlentry"
|
||||
echo "#endif"
|
||||
fi
|
||||
else
|
||||
echo "#ifdef CONFIG_X86_32"
|
||||
|
||||
Reference in New Issue
Block a user