diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-11 16:01:16 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-11 16:04:20 -0400 |
commit | 58633d29b872f9cf171f00bcf2804bb2c28e3d74 (patch) | |
tree | 9ea8fa89b7448268dc36f39022f6afff46f457b3 /sys/include | |
parent | 5c6f79744a8bdf4cfb0e91517847281739c3e624 (diff) |
kernel: timer: Add flags field + TIMER_MONOTONICexpt
Sometimes we may rely on a specific kind of timer. While we are able to
grab scheduler specific timers, general purpose timers, etc. One might
need to for example, check whether their general purpose timer timer is
monotonic or not.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/dev/timer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/include/dev/timer.h b/sys/include/dev/timer.h index fe91323..2ca6d62 100644 --- a/sys/include/dev/timer.h +++ b/sys/include/dev/timer.h @@ -31,11 +31,15 @@ #define _DEV_TIMER_H_ #include <sys/types.h> +#include <sys/param.h> /* Timer IDs */ #define TIMER_SCHED 0x00000000U /* Scheduler reserved timer */ #define TIMER_GP 0x00000001U /* General purpose timer */ +/* Timer flags */ +#define TIMER_MONOTONIC BIT(0) + /* Number of timer IDs, adjust when adding timer IDs */ #define TIMER_ID_COUNT 2 @@ -79,6 +83,7 @@ struct timer { void(*oneshot_ms)(size_t ms); void(*oneshot_us)(size_t ms); void(*stop)(void); + uint8_t flags; }; tmrr_status_t register_timer(timer_id_t id, const struct timer *tmr); |