blob: 980a65594412d95b56ed871b26fc5bbd06e11a69 [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;
Arnd Bergmann9afc5ee2018-07-13 12:52:28 +020013struct old_timespec32;
Mark Rutland53d74d02016-10-19 19:28:12 +010014struct 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 {
Oleg Nesterovb2e9df82021-02-01 18:47:16 +010026 unsigned long arch_data;
Mark Rutland53d74d02016-10-19 19:28:12 +010027 long (*fn)(struct restart_block *);
28 union {
29 /* For futex_wait and futex_wait_requeue_pi */
30 struct {
31 u32 __user *uaddr;
32 u32 val;
33 u32 flags;
34 u32 bitset;
35 u64 time;
36 u32 __user *uaddr2;
37 } futex;
38 /* For nanosleep */
39 struct {
40 clockid_t clockid;
Al Viroedbeda42017-06-07 09:42:31 +010041 enum timespec_type type;
42 union {
Deepa Dinamani01909972018-03-13 21:03:33 -070043 struct __kernel_timespec __user *rmtp;
Arnd Bergmann9afc5ee2018-07-13 12:52:28 +020044 struct old_timespec32 __user *compat_rmtp;
Al Viroedbeda42017-06-07 09:42:31 +010045 };
Mark Rutland53d74d02016-10-19 19:28:12 +010046 u64 expires;
47 } nanosleep;
48 /* For poll */
49 struct {
50 struct pollfd __user *ufds;
51 int nfds;
52 int has_timeout;
53 unsigned long tv_sec;
54 unsigned long tv_nsec;
55 } poll;
56 };
57};
58
59extern long do_no_restart_syscall(struct restart_block *parm);
60
61#endif /* __LINUX_RESTART_BLOCK_H */