diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/acall.h | 54 | ||||
-rw-r--r-- | include/linux/mm_types.h | 2 | ||||
-rw-r--r-- | include/linux/syscalls.h | 18 |
3 files changed, 74 insertions, 0 deletions
diff --git a/include/linux/acall.h b/include/linux/acall.h new file mode 100644 index 000000000000..f6d3f6b854af --- /dev/null +++ b/include/linux/acall.h @@ -0,0 +1,54 @@ +#ifndef __LINUX_ACALL_H +#define __LINUX_ACALL_H + +/* + * The kernel makes a private copy of this during sys_acall_submit(). Once + * that call returns userspace does not need to keep it around. + * + * The flags field will be used to indicate the presence of fields which + * are added to the end of the struct over time. To support this the + * submission call must refuse submission for structs which contain flags + * which it doesn't recognize. + */ +struct acall_submission { + u32 nr; + u32 flags; + u64 cookie; + u64 completion_ring_pointer; + u64 completion_pointer; + u64 id_pointer; + u64 args[6]; +}; + +#define ACALL_SUBMIT_THREAD_POOL 1 + +/* + * This is used by userspace to specify an operation for cancelation or + * waiting. The data here only has significance to the kernel. + */ +struct acall_id { + unsigned char opaque[16]; +}; + +struct acall_completion { + u64 return_code; + u64 cookie; +}; + +/* + * 'nr' is read by the kernel each time it tries to store an event in + * the ring. + * + * 'head' is written by the kernel as it adds events. Once it changes than + * the kernel will be writing an acall_completion struct into the ring. + * A non-zero cookie field of the completion struct indicates that the + * completion has been written. Once it is non-zero then the return_code + * can be loaded after issuing a read memory barrier. + */ +struct acall_completion_ring { + u32 head; + u32 nr; + struct acall_completion comps[0]; +}; + +#endif diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0e80e26ecf21..4eb375557534 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -21,6 +21,7 @@ #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) struct address_space; +struct acall_mm; #define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) @@ -278,6 +279,7 @@ struct mm_struct { #ifdef CONFIG_MMU_NOTIFIER struct mmu_notifier_mm *mmu_notifier_mm; #endif + struct acall_mm *acall_mm; }; /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 30520844b8da..5a72e5b2ba58 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -55,6 +55,9 @@ struct compat_timeval; struct robust_list_head; struct getcpu_cache; struct old_linux_dirent; +struct acall_submission; +struct acall_id; +struct acall_completion_ring; #include <linux/types.h> #include <linux/aio_abi.h> @@ -752,7 +755,22 @@ asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, size_t); asmlinkage long sys_pipe2(int __user *, int); asmlinkage long sys_pipe(int __user *); +asmlinkage long sys_acall_submit(struct acall_submission __user *submissions, + unsigned long nr); +asmlinkage long sys_acall_comp_pwait(struct acall_id __user *uids, + unsigned long nr, + struct timespec __user *utime, + const sigset_t __user *sigmask, + size_t sigsetsize); +asmlinkage long sys_acall_ring_pwait(struct acall_completion_ring __user *uring, + u32 tail, u32 min, + struct timespec __user *utime, + const sigset_t __user *sigmask, + size_t sigsetsize); int kernel_execve(const char *filename, char *const argv[], char *const envp[]); +long arch_call_syscall(unsigned int nr, long arg0, long arg1, long arg2, + long arg3, long arg4, long arg5); + #endif |