Timer
include/time/timer.h View source View on GitHubtimer_flags: 32 bit bitflags
┌───────────────────────────────────────────────────────┐Bits │ 31..28 27..24 23..20 19..16 15..12 11..8 7..4 3..0 │Use │ %%%% %%%% %%Pd ID## #### #### #### #### │ └───────────────────────────────────────────────────────┘I - IRQ timer - not executed in DPC D - Deferrable (Only activates when CPU non-idle) d - DPC queued P - Pinned
%%% - Bucket idx (if present, up to 1023) **- CPU target for this timer** A - Unused (available) * - Unused (unavailable)
Structs
Section titled “Structs” struct timer (5 fields) source
timer_flags
Section titled “timer_flags” enum timer_flags (5 variants) source
Functions
Section titled “Functions”timer_bucket_set
Section titled “timer_bucket_set”timer_bucket_get
Section titled “timer_bucket_get”timer_cpu_set
Section titled “timer_cpu_set”timer_cpu_get
Section titled “timer_cpu_get”timer_init
Section titled “timer_init”timer_add
Section titled “timer_add”timer_add_on
Section titled “timer_add_on”timer_add_local
Section titled “timer_add_local”timer_add_global
Section titled “timer_add_global”timer_modify
Section titled “timer_modify”timer_modify_pending
Section titled “timer_modify_pending”timer_modify_reduce
Section titled “timer_modify_reduce”Only modify if new is nearer than expiration
timer_delete
Section titled “timer_delete”_sync() functions wait for the handler to finish,
and non-_sync() functions do not
timer_delete_sync
Section titled “timer_delete_sync”timer_shutdown
Section titled “timer_shutdown”timer_shutdown_sync
Section titled “timer_shutdown_sync”timer_isr
Section titled “timer_isr”enum irq_result timer_isr(struct irq_context *ctx, void *c) source timers_init_bsp
Section titled “timers_init_bsp”void timers_init_bsp(void) source timers_init_ap
Section titled “timers_init_ap”timer_delta_us
Section titled “timer_delta_us”Macros
Section titled “Macros”TIMER_FLAG_CPU_MASK
Section titled “TIMER_FLAG_CPU_MASK”#define TIMER_FLAG_CPU_MASK 0x0003FFFF source TIMER_FLAG_CPU
Section titled “TIMER_FLAG_CPU”#define TIMER_FLAG_CPU(c) source Expansion
#define TIMER_FLAG_CPU(c) ((c) & TIMER_FLAG_CPU_MASK) TIMER_FLAG_BUCKET_MASK
Section titled “TIMER_FLAG_BUCKET_MASK”#define TIMER_FLAG_BUCKET_MASK 0x3FFu source TIMER_FLAG_BUCKET_SHIFT
Section titled “TIMER_FLAG_BUCKET_SHIFT”#define TIMER_FLAG_BUCKET_SHIFT 22 source TIMER_FLAG_BUCKET
Section titled “TIMER_FLAG_BUCKET”#define TIMER_FLAG_BUCKET(b) source Expansion
#define TIMER_FLAG_BUCKET(b) \
(((b) & TIMER_FLAG_BUCKET_MASK) << TIMER_FLAG_BUCKET_SHIFT) TIMER_DEFINE
Section titled “TIMER_DEFINE”#define TIMER_DEFINE(n, fn, ...) source Expansion
#define TIMER_DEFINE(n, fn, ...) \
struct timer n = (struct timer) { \
.func = fn \
}