restart_block.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Common syscall restarting data
  4. */
  5. #ifndef __LINUX_RESTART_BLOCK_H
  6. #define __LINUX_RESTART_BLOCK_H
  7. #include <linux/compiler.h>
  8. #include <linux/types.h>
  9. #include <linux/time64.h>
  10. struct timespec;
  11. struct old_timespec32;
  12. struct pollfd;
  13. enum timespec_type {
  14. TT_NONE = 0,
  15. TT_NATIVE = 1,
  16. TT_COMPAT = 2,
  17. };
  18. /*
  19. * System call restart block.
  20. */
  21. struct restart_block {
  22. long (*fn)(struct restart_block *);
  23. union {
  24. /* For futex_wait and futex_wait_requeue_pi */
  25. struct {
  26. u32 __user *uaddr;
  27. u32 val;
  28. u32 flags;
  29. u32 bitset;
  30. u64 time;
  31. u32 __user *uaddr2;
  32. } futex;
  33. /* For nanosleep */
  34. struct {
  35. clockid_t clockid;
  36. enum timespec_type type;
  37. union {
  38. struct __kernel_timespec __user *rmtp;
  39. struct old_timespec32 __user *compat_rmtp;
  40. };
  41. u64 expires;
  42. } nanosleep;
  43. /* For poll */
  44. struct {
  45. struct pollfd __user *ufds;
  46. int nfds;
  47. int has_timeout;
  48. unsigned long tv_sec;
  49. unsigned long tv_nsec;
  50. } poll;
  51. };
  52. };
  53. extern long do_no_restart_syscall(struct restart_block *parm);
  54. #endif /* __LINUX_RESTART_BLOCK_H */