at commit 89c2c777
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _LINUX_HRTIMER_TYPES_H |
| 3 | #define _LINUX_HRTIMER_TYPES_H |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/timerqueue_types.h> |
| 7 | |
| 8 | struct hrtimer_clock_base; |
| 9 | |
| 10 | /* |
| 11 | * Return values for the callback function |
| 12 | */ |
| 13 | enum hrtimer_restart { |
| 14 | HRTIMER_NORESTART, /* Timer is not restarted */ |
| 15 | HRTIMER_RESTART, /* Timer must be restarted */ |
| 16 | }; |
| 17 | |
| 18 | /** |
| 19 | * struct hrtimer - the basic hrtimer structure |
| 20 | * @node: Linked timerqueue node, which also manages node.expires, |
| 21 | * the absolute expiry time in the hrtimers internal |
| 22 | * representation. The time is related to the clock on |
| 23 | * which the timer is based. Is setup by adding |
| 24 | * slack to the _softexpires value. For non range timers |
| 25 | * identical to _softexpires. |
| 26 | * @_softexpires: the absolute earliest expiry time of the hrtimer. |
| 27 | * The time which was given as expiry time when the timer |
| 28 | * was armed. |
| 29 | * @function: timer expiry callback function |
| 30 | * @base: pointer to the timer base (per cpu and per clock) |
| 31 | * @is_queued: Indicates whether a timer is enqueued or not |
| 32 | * @is_rel: Set if the timer was armed relative |
| 33 | * @is_soft: Set if hrtimer will be expired in soft interrupt context. |
| 34 | * @is_hard: Set if hrtimer will be expired in hard interrupt context |
| 35 | * even on RT. |
| 36 | * @is_lazy: Set if the timer is frequently rearmed to avoid updates |
| 37 | * of the clock event device |
| 38 | * |
| 39 | * The hrtimer structure must be initialized by hrtimer_setup() |
| 40 | */ |
| 41 | struct hrtimer { |
| 42 | struct timerqueue_linked_node node; |
| 43 | struct hrtimer_clock_base *base; |
| 44 | bool is_queued; |
| 45 | bool is_rel; |
| 46 | bool is_soft; |
| 47 | bool is_hard; |
| 48 | bool is_lazy; |
| 49 | ktime_t _softexpires; |
| 50 | enum hrtimer_restart (*__private function)(struct hrtimer *); |
| 51 | }; |
| 52 | |
| 53 | #endif /* _LINUX_HRTIMER_TYPES_H */ |