diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-10-11 13:36:15 -0700 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2012-10-11 13:36:15 -0700 |
commit | 21a0765a50fff349155964432b9529541eee5e8a (patch) | |
tree | f605ce5afbeb7d2dce0ee8c546f47d98ea5f48fb /arch | |
parent | 07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff) |
acallacall
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd_32.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd_64.h | 8 | ||||
-rw-r--r-- | arch/x86/kernel/process_32.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_64.c | 14 |
5 files changed, 47 insertions, 0 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index a505202086e8..167a4b3ca051 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -830,4 +830,8 @@ ia32_sys_call_table: .quad sys_inotify_init1 .quad compat_sys_preadv .quad compat_sys_pwritev + .quad sys_acall_submit /* 335 */ + .quad compat_sys_acall_comp_pwait + .quad compat_sys_acall_ring_pwait + .quad sys_acall_cancel ia32_syscall_end: diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index 6e72d74cf8dc..157d86af59b3 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h @@ -340,6 +340,10 @@ #define __NR_inotify_init1 332 #define __NR_preadv 333 #define __NR_pwritev 334 +#define __NR_acall_submit 335 +#define __NR_acall_comp_pwait 336 +#define __NR_acall_ring_pwait 337 +#define __NR_acall_cancel 338 #ifdef __KERNEL__ diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index f81829462325..cf98b8fd0e1f 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h @@ -657,6 +657,14 @@ __SYSCALL(__NR_inotify_init1, sys_inotify_init1) __SYSCALL(__NR_preadv, sys_preadv) #define __NR_pwritev 296 __SYSCALL(__NR_pwritev, sys_pwritev) +#define __NR_acall_submit 297 +__SYSCALL(__NR_acall_submit, sys_acall_submit) +#define __NR_acall_comp_pwait 298 +__SYSCALL(__NR_acall_comp_pwait, sys_acall_comp_pwait) +#define __NR_acall_ring_pwait 299 +__SYSCALL(__NR_acall_ring_pwait, sys_acall_ring_pwait) +#define __NR_acall_cancel 300 +__SYSCALL(__NR_acall_cancel, sys_acall_cancel) #ifndef __NO_STUBS diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 76f8f84043a2..6d18b975674a 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -509,3 +509,20 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) unsigned long range_end = mm->brk + 0x02000000; return randomize_range(mm->brk, range_end, 0) ? : mm->brk; } + +/* + * XXX This is just a dumb place-holder for testing until we find out how + * the x86 maintainers want this done. + */ +long arch_call_syscall(unsigned int nr, long arg0, long arg1, long arg2, + long arg3, long arg4, long arg5) +{ + typedef asmlinkage long (*syscall_fn_t)(long, long, long, long, long, + long); + syscall_fn_t *calls = (syscall_fn_t *)sys_call_table; + + if (nr > __NR_acall_cancel) + return -ENOSYS; + + return calls[nr](arg0, arg1, arg2, arg3, arg4, arg5); +} diff --git a/arch/x86/kernel/syscall_64.c b/arch/x86/kernel/syscall_64.c index de87d6008295..f5d5f6aac664 100644 --- a/arch/x86/kernel/syscall_64.c +++ b/arch/x86/kernel/syscall_64.c @@ -3,6 +3,7 @@ #include <linux/linkage.h> #include <linux/sys.h> #include <linux/cache.h> +#include <linux/errno.h> #include <asm/asm-offsets.h> #define __NO_STUBS @@ -27,3 +28,16 @@ const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { [0 ... __NR_syscall_max] = &sys_ni_syscall, #include <asm/unistd_64.h> }; + +long arch_call_syscall(unsigned int nr, long arg0, long arg1, long arg2, + long arg3, long arg4, long arg5) +{ + typedef asmlinkage long (*syscall_fn_t)(long, long, long, long, long, + long); + syscall_fn_t *calls = (syscall_fn_t *)sys_call_table; + + if (nr > __NR_syscall_max) + return -ENOSYS; + + return calls[nr](arg0, arg1, arg2, arg3, arg4, arg5); +} |