Linux 6.9-rc1
[linux-2.6-microblaze.git] / include / linux / syscall_user_dispatch.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020 Collabora Ltd.
4  */
5 #ifndef _SYSCALL_USER_DISPATCH_H
6 #define _SYSCALL_USER_DISPATCH_H
7
8 #include <linux/thread_info.h>
9 #include <linux/syscall_user_dispatch_types.h>
10
11 #ifdef CONFIG_GENERIC_ENTRY
12
13 int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
14                               unsigned long len, char __user *selector);
15
16 #define clear_syscall_work_syscall_user_dispatch(tsk) \
17         clear_task_syscall_work(tsk, SYSCALL_USER_DISPATCH)
18
19 int syscall_user_dispatch_get_config(struct task_struct *task, unsigned long size,
20                                      void __user *data);
21
22 int syscall_user_dispatch_set_config(struct task_struct *task, unsigned long size,
23                                      void __user *data);
24
25 #else
26
27 static inline int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
28                                             unsigned long len, char __user *selector)
29 {
30         return -EINVAL;
31 }
32
33 static inline void clear_syscall_work_syscall_user_dispatch(struct task_struct *tsk)
34 {
35 }
36
37 static inline int syscall_user_dispatch_get_config(struct task_struct *task,
38                                                    unsigned long size, void __user *data)
39 {
40         return -EINVAL;
41 }
42
43 static inline int syscall_user_dispatch_set_config(struct task_struct *task,
44                                                    unsigned long size, void __user *data)
45 {
46         return -EINVAL;
47 }
48
49 #endif /* CONFIG_GENERIC_ENTRY */
50
51 #endif /* _SYSCALL_USER_DISPATCH_H */