1SCHEDULE_HRTIMEOUT_R(9) Driver Basics SCHEDULE_HRTIMEOUT_R(9)
2
3
4
6 schedule_hrtimeout_range - sleep until timeout
7
9 int __sched schedule_hrtimeout_range(ktime_t * expires,
10 unsigned long delta,
11 const enum hrtimer_mode mode);
12
14 expires
15 timeout value (ktime_t)
16
17 delta
18 slack in expires timeout (ktime_t)
19
20 mode
21 timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
22
24 Make the current task sleep until the given expiry time has elapsed.
25 The routine will return immediately unless the current task state has
26 been set (see set_current_state).
27
28 The delta argument gives the kernel the freedom to schedule the actual
29 wakeup to a time that is both power and performance friendly. The
30 kernel give the normal best effort behavior for “expires+delta”, but
31 may decide to fire the timer earlier, but no earlier than expires.
32
33 You can set the task state as follows -
34
35 TASK_UNINTERRUPTIBLE - at least timeout time is guaranteed to pass
36 before the routine returns.
37
38 TASK_INTERRUPTIBLE - the routine may return early if a signal is
39 delivered to the current task.
40
41 The current task state is guaranteed to be TASK_RUNNING when this
42 routine returns.
43
44 Returns 0 when the timer has expired otherwise -EINTR
45
47Kernel Hackers Manual 3.10 June 2019 SCHEDULE_HRTIMEOUT_R(9)