Skip to content

Commit 2183224

Browse files
Brian GerstIngo Molnar
authored andcommitted
x86/syscall/x32: Move x32 syscall table
Since commit: 2e958a8 ("x86/entry/x32: Rename __x32_compat_sys_* to __x64_compat_sys_*") the ABI prefix for x32 syscalls is the same as native 64-bit syscalls. Move the x32 syscall table to syscall_64.c No functional changes. Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 01dfb48 commit 2183224

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

arch/x86/entry/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ CFLAGS_REMOVE_entry_fred.o += -pg $(CC_FLAGS_FTRACE)
2727
obj-$(CONFIG_X86_FRED) += entry_64_fred.o entry_fred.o
2828

2929
obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
30-
obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o

arch/x86/entry/syscall_64.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#define __SYSCALL(nr, sym) extern long __x64_##sym(const struct pt_regs *);
1313
#define __SYSCALL_NORETURN(nr, sym) extern long __noreturn __x64_##sym(const struct pt_regs *);
1414
#include <asm/syscalls_64.h>
15+
#ifdef CONFIG_X86_X32_ABI
16+
#include <asm/syscalls_x32.h>
17+
#endif
1518
#undef __SYSCALL
1619

1720
#undef __SYSCALL_NORETURN
@@ -37,6 +40,16 @@ long x64_sys_call(const struct pt_regs *regs, unsigned int nr)
3740
}
3841
};
3942

43+
#ifdef CONFIG_X86_X32_ABI
44+
long x32_sys_call(const struct pt_regs *regs, unsigned int nr)
45+
{
46+
switch (nr) {
47+
#include <asm/syscalls_x32.h>
48+
default: return __x64_sys_ni_syscall(regs);
49+
}
50+
};
51+
#endif
52+
4053
static __always_inline bool do_syscall_x64(struct pt_regs *regs, int nr)
4154
{
4255
/*

arch/x86/entry/syscall_x32.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)