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
10#ifdef CONFIG_GENERIC_ENTRY
11
12struct syscall_user_dispatch {
13 char __user *selector;
14 unsigned long offset;
15 unsigned long len;
16 bool on_dispatch;
17};
18
19int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
20 unsigned long len, char __user *selector);
21
22#define clear_syscall_work_syscall_user_dispatch(tsk) \
23 clear_task_syscall_work(tsk, SYSCALL_USER_DISPATCH)
24
25int syscall_user_dispatch_get_config(struct task_struct *task, unsigned long size,
26 void __user *data);
27
28int syscall_user_dispatch_set_config(struct task_struct *task, unsigned long size,
29 void __user *data);
30
31#else
32struct syscall_user_dispatch {};
33
34static inline int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
35 unsigned long len, char __user *selector)
36{
37 return -EINVAL;
38}
39
40static inline void clear_syscall_work_syscall_user_dispatch(struct task_struct *tsk)
41{
42}
43
44static inline int syscall_user_dispatch_get_config(struct task_struct *task,
45 unsigned long size, void __user *data)
46{
47 return -EINVAL;
48}
49
50static inline int syscall_user_dispatch_set_config(struct task_struct *task,
51 unsigned long size, void __user *data)
52{
53 return -EINVAL;
54}
55
56#endif /* CONFIG_GENERIC_ENTRY */
57
58#endif /* _SYSCALL_USER_DISPATCH_H */
59

source code of linux/include/linux/syscall_user_dispatch.h