restart_block.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. unsigned long arch_data;
  23. long (*fn)(struct restart_block *);
  24. union {
  25. /* For futex_wait and futex_wait_requeue_pi */
  26. struct {
  27. u32 __user *uaddr;
  28. u32 val;
  29. u32 flags;
  30. u32 bitset;
  31. u64 time;
  32. u32 __user *uaddr2;
  33. } futex;
  34. /* For nanosleep */
  35. struct {
  36. clockid_t clockid;
  37. enum timespec_type type;
  38. union {
  39. struct __kernel_timespec __user *rmtp;
  40. struct old_timespec32 __user *compat_rmtp;
  41. };
  42. u64 expires;
  43. } nanosleep;
  44. /* For poll */
  45. struct {
  46. struct pollfd __user *ufds;
  47. int nfds;
  48. int has_timeout;
  49. unsigned long tv_sec;
  50. unsigned long tv_nsec;
  51. } poll;
  52. };
  53. };
  54. extern long do_no_restart_syscall(struct restart_block *parm);
  55. #endif /* __LINUX_RESTART_BLOCK_H */