Skip to content

Commit

Permalink
x86/entry/syscalls: Move syscall table declarations into asm/syscalls.h
Browse files Browse the repository at this point in the history
The header was missing some compat declarations.

Also make sys_call_ptr_t have a consistent type.

Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/3166aaff0fb43897998fcb6ef92991533f8c5c6c.1444091585.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
amluto authored and Ingo Molnar committed Oct 9, 2015
1 parent 8169aff commit 034042c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 1 addition & 4 deletions arch/x86/entry/syscall_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
#include <linux/sys.h>
#include <linux/cache.h>
#include <asm/asm-offsets.h>
#include <asm/syscall.h>

#ifdef CONFIG_IA32_EMULATION
#define SYM(sym, compat) compat
#else
#define SYM(sym, compat) sym
#define ia32_sys_call_table sys_call_table
#define __NR_syscall_compat_max __NR_syscall_max
#endif

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

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

typedef asmlinkage void (*sys_call_ptr_t)(void);

extern asmlinkage void sys_ni_syscall(void);

__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {
Expand Down
12 changes: 11 additions & 1 deletion arch/x86/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@
#include <asm/thread_info.h> /* for TS_COMPAT */
#include <asm/unistd.h>

typedef void (*sys_call_ptr_t)(void);
typedef asmlinkage void (*sys_call_ptr_t)(void);
extern const sys_call_ptr_t sys_call_table[];

#if defined(CONFIG_X86_32)
#define ia32_sys_call_table sys_call_table
#define __NR_syscall_compat_max __NR_syscall_max
#define IA32_NR_syscalls NR_syscalls
#endif

#if defined(CONFIG_IA32_EMULATION)
extern const sys_call_ptr_t ia32_sys_call_table[];
#endif

/*
* Only the low 32 bits of orig_ax are meaningful, so we return int.
* This importantly ignores the high bits on 64-bit, so comparisons
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/um/sys_call_table_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/sys.h>
#include <linux/cache.h>
#include <generated/user_constants.h>
#include <asm/syscall.h>

#define __NO_STUBS

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

typedef asmlinkage void (*sys_call_ptr_t)(void);

extern asmlinkage void sys_ni_syscall(void);

const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/um/sys_call_table_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/sys.h>
#include <linux/cache.h>
#include <generated/user_constants.h>
#include <asm/syscall.h>

#define __NO_STUBS

Expand Down Expand Up @@ -43,8 +44,6 @@
#undef __SYSCALL_64
#define __SYSCALL_64(nr, sym, compat) [ nr ] = sym,

typedef void (*sys_call_ptr_t)(void);

extern void sys_ni_syscall(void);

const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {
Expand Down

0 comments on commit 034042c

Please sign in to comment.