diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2024-10-01 10:42:09 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2024-10-29 11:43:19 +0100 |
| commit | 1550dde8a537b35dbf066c7f9cfe5f9b360bce0d (patch) | |
| tree | b4c2b18f660d1024e1afa06d5229257732815930 /kernel/time/posix-timers.h | |
| parent | posix-timers: Rename k_itimer:: It_requeue_pending (diff) | |
| download | linux-1550dde8a537b35dbf066c7f9cfe5f9b360bce0d.tar.gz linux-1550dde8a537b35dbf066c7f9cfe5f9b360bce0d.zip | |
posix-timers: Add proper state tracking
Right now the state tracking is done by two struct members:
- it_active:
A boolean which tracks armed/disarmed state
- it_signal_seq:
A sequence counter which is used to invalidate settings
and prevent rearming
Replace it_active with it_status and keep properly track about the states
in one place.
This allows to reuse it_signal_seq to track reprogramming, disarm and
delete operations in order to drop signals which are related to the state
previous of those operations.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20241001083835.670337048@linutronix.de
Diffstat (limited to 'kernel/time/posix-timers.h')
| -rw-r--r-- | kernel/time/posix-timers.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h index 4784ea65f685..4d09677e584e 100644 --- a/kernel/time/posix-timers.h +++ b/kernel/time/posix-timers.h @@ -1,6 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0 */ #define TIMER_RETRY 1 +enum posix_timer_state { + POSIX_TIMER_DISARMED, + POSIX_TIMER_ARMED, + POSIX_TIMER_REQUEUE_PENDING, +}; + struct k_clock { int (*clock_getres)(const clockid_t which_clock, struct timespec64 *tp); |
