syscall_user_dispatch.h 930 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include <linux/thread_info.h>
  8. #ifdef CONFIG_GENERIC_ENTRY
  9. struct syscall_user_dispatch {
  10. char __user *selector;
  11. unsigned long offset;
  12. unsigned long len;
  13. bool on_dispatch;
  14. };
  15. int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
  16. unsigned long len, char __user *selector);
  17. #define clear_syscall_work_syscall_user_dispatch(tsk) \
  18. clear_task_syscall_work(tsk, SYSCALL_USER_DISPATCH)
  19. #else
  20. struct syscall_user_dispatch {};
  21. static inline int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
  22. unsigned long len, char __user *selector)
  23. {
  24. return -EINVAL;
  25. }
  26. static inline void clear_syscall_work_syscall_user_dispatch(struct task_struct *tsk)
  27. {
  28. }
  29. #endif /* CONFIG_GENERIC_ENTRY */
  30. #endif /* _SYSCALL_USER_DISPATCH_H */