aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/um/sys_call_table_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/um/sys_call_table_64.c')
-rw-r--r--arch/x86/um/sys_call_table_64.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c
index 99522f78b162..fe626c3ba01b 100644
--- a/arch/x86/um/sys_call_table_64.c
+++ b/arch/x86/um/sys_call_table_64.c
@@ -1,11 +1,12 @@
1/* 1/*
2 * System call table for UML/x86-64, copied from arch/x86_64/kernel/syscall.c 2 * System call table for UML/x86-64, copied from arch/x86/kernel/syscall_*.c
3 * with some changes for UML. 3 * with some changes for UML.
4 */ 4 */
5 5
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <linux/sys.h> 7#include <linux/sys.h>
8#include <linux/cache.h> 8#include <linux/cache.h>
9#include <generated/user_constants.h>
9 10
10#define __NO_STUBS 11#define __NO_STUBS
11 12
@@ -34,31 +35,23 @@
34#define stub_sigaltstack sys_sigaltstack 35#define stub_sigaltstack sys_sigaltstack
35#define stub_rt_sigreturn sys_rt_sigreturn 36#define stub_rt_sigreturn sys_rt_sigreturn
36 37
37#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; 38#define __SYSCALL_64(nr, sym, compat) extern asmlinkage void sym(void) ;
38#undef _ASM_X86_UNISTD_64_H 39#include <asm/syscalls_64.h>
39#include "../../x86/include/asm/unistd_64.h"
40 40
41#undef __SYSCALL 41#undef __SYSCALL_64
42#define __SYSCALL(nr, sym) [ nr ] = sym, 42#define __SYSCALL_64(nr, sym, compat) [ nr ] = sym,
43#undef _ASM_X86_UNISTD_64_H
44 43
45typedef void (*sys_call_ptr_t)(void); 44typedef void (*sys_call_ptr_t)(void);
46 45
47extern void sys_ni_syscall(void); 46extern void sys_ni_syscall(void);
48 47
49/* 48const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
50 * We used to have a trick here which made sure that holes in the 49 /*
51 * x86_64 table were filled in with sys_ni_syscall, but a comment in 50 * Smells like a compiler bug -- it doesn't work
52 * unistd_64.h says that holes aren't allowed, so the trick was 51 * when the & below is removed.
53 * removed. 52 */
54 * The trick looked like this 53 [0 ... __NR_syscall_max] = &sys_ni_syscall,
55 * [0 ... UM_NR_syscall_max] = &sys_ni_syscall 54#include <asm/syscalls_64.h>
56 * before including unistd_64.h - the later initializations overwrote
57 * the sys_ni_syscall filler.
58 */
59
60sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
61#include <asm/unistd_64.h>
62}; 55};
63 56
64int syscall_table_size = sizeof(sys_call_table); 57int syscall_table_size = sizeof(sys_call_table);