blob: 5d83d0c1d06cc22507d8b8e03d75e0bf8de32fd8 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Mark Rutland53d74d02016-10-19 19:28:12 +01002/*
3 * Common syscall restarting data
4 */
5#ifndef __LINUX_RESTART_BLOCK_H
6#define __LINUX_RESTART_BLOCK_H
7
8#include <linux/compiler.h>
9#include <linux/types.h>
Deepa Dinamani01909972018-03-13 21:03:33 -070010#include <linux/time64.h>
Mark Rutland53d74d02016-10-19 19:28:12 +010011
12struct timespec;
13struct compat_timespec;
14struct pollfd;
15
Al Viroedbeda42017-06-07 09:42:31 +010016enum timespec_type {
17 TT_NONE = 0,
18 TT_NATIVE = 1,
Al Viroedbeda42017-06-07 09:42:31 +010019 TT_COMPAT = 2,
Al Viroedbeda42017-06-07 09:42:31 +010020};
21
Mark Rutland53d74d02016-10-19 19:28:12 +010022/*
23 * System call restart block.
24 */
25struct restart_block {
26 long (*fn)(struct restart_block *);
27 union {
28 /* For futex_wait and futex_wait_requeue_pi */
29 struct {
30 u32 __user *uaddr;
31 u32 val;
32 u32 flags;
33 u32 bitset;
34 u64 time;
35 u32 __user *uaddr2;
36 } futex;
37 /* For nanosleep */
38 struct {
39 clockid_t clockid;
Al Viroedbeda42017-06-07 09:42:31 +010040 enum timespec_type type;
41 union {
Deepa Dinamani01909972018-03-13 21:03:33 -070042 struct __kernel_timespec __user *rmtp;
Al Viroedbeda42017-06-07 09:42:31 +010043 struct compat_timespec __user *compat_rmtp;
Al Viroedbeda42017-06-07 09:42:31 +010044 };
Mark Rutland53d74d02016-10-19 19:28:12 +010045 u64 expires;
46 } nanosleep;
47 /* For poll */
48 struct {
49 struct pollfd __user *ufds;
50 int nfds;
51 int has_timeout;
52 unsigned long tv_sec;
53 unsigned long tv_nsec;
54 } poll;
55 };
56};
57
58extern long do_no_restart_syscall(struct restart_block *parm);
59
60#endif /* __LINUX_RESTART_BLOCK_H */