Skip to content

Commit 034042c

Browse files
amlutoIngo Molnar
authored andcommitted
x86/entry/syscalls: Move syscall table declarations into asm/syscalls.h
The header was missing some compat declarations. Also make sys_call_ptr_t have a consistent type. Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/3166aaff0fb43897998fcb6ef92991533f8c5c6c.1444091585.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 8169aff commit 034042c

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

arch/x86/entry/syscall_32.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
#include <linux/sys.h>
55
#include <linux/cache.h>
66
#include <asm/asm-offsets.h>
7+
#include <asm/syscall.h>
78

89
#ifdef CONFIG_IA32_EMULATION
910
#define SYM(sym, compat) compat
1011
#else
1112
#define SYM(sym, compat) sym
12-
#define ia32_sys_call_table sys_call_table
13-
#define __NR_syscall_compat_max __NR_syscall_max
1413
#endif
1514

1615
#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void SYM(sym, compat)(void) ;
@@ -19,8 +18,6 @@
1918

2019
#define __SYSCALL_I386(nr, sym, compat) [nr] = SYM(sym, compat),
2120

22-
typedef asmlinkage void (*sys_call_ptr_t)(void);
23-
2421
extern asmlinkage void sys_ni_syscall(void);
2522

2623
__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {

arch/x86/include/asm/syscall.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@
2020
#include <asm/thread_info.h> /* for TS_COMPAT */
2121
#include <asm/unistd.h>
2222

23-
typedef void (*sys_call_ptr_t)(void);
23+
typedef asmlinkage void (*sys_call_ptr_t)(void);
2424
extern const sys_call_ptr_t sys_call_table[];
2525

26+
#if defined(CONFIG_X86_32)
27+
#define ia32_sys_call_table sys_call_table
28+
#define __NR_syscall_compat_max __NR_syscall_max
29+
#define IA32_NR_syscalls NR_syscalls
30+
#endif
31+
32+
#if defined(CONFIG_IA32_EMULATION)
33+
extern const sys_call_ptr_t ia32_sys_call_table[];
34+
#endif
35+
2636
/*
2737
* Only the low 32 bits of orig_ax are meaningful, so we return int.
2838
* This importantly ignores the high bits on 64-bit, so comparisons

arch/x86/um/sys_call_table_32.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/sys.h>
88
#include <linux/cache.h>
99
#include <generated/user_constants.h>
10+
#include <asm/syscall.h>
1011

1112
#define __NO_STUBS
1213

@@ -30,8 +31,6 @@
3031
#undef __SYSCALL_I386
3132
#define __SYSCALL_I386(nr, sym, compat) [ nr ] = sym,
3233

33-
typedef asmlinkage void (*sys_call_ptr_t)(void);
34-
3534
extern asmlinkage void sys_ni_syscall(void);
3635

3736
const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {

arch/x86/um/sys_call_table_64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/sys.h>
88
#include <linux/cache.h>
99
#include <generated/user_constants.h>
10+
#include <asm/syscall.h>
1011

1112
#define __NO_STUBS
1213

@@ -43,8 +44,6 @@
4344
#undef __SYSCALL_64
4445
#define __SYSCALL_64(nr, sym, compat) [ nr ] = sym,
4546

46-
typedef void (*sys_call_ptr_t)(void);
47-
4847
extern void sys_ni_syscall(void);
4948

5049
const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {

0 commit comments

Comments
 (0)