STRUCT CLOCK_EVENT_DEVICE(9)
๐ NAME ๐
okay so you opened the struct clock_event_device(9) page in the Kernel API Manual, and the NAME section is literally clock event device descriptor โ thatโs the whole vibe, bestie ๐
. This struct is the descriptor for a clock event device, and weโre about to go through every field like itโs a group-chat roll call ๐
โจ SYNOPSIS โจ
hereโs the struct, copied exactly so thereโs zero ambiguity, no cap:
struct clock_event_device {
void (*event_handler)(struct clock_event_device *);
int (*set_next_event)(unsigned long evt, struct clock_event_device
*);
int (*set_next_ktime)(ktime_t expires, struct clock_event_device *);
void (*set_next_coupled)(u64 cycles, struct clock_event_device *);
ktime_t next_event;
u64 max_delta_ns;
u64 min_delta_ns;
u32 mult;
u32 shift;
enum clock_event_state state_use_accessors;
unsigned int features;
enum clocksource_ids cs_id;
unsigned int next_event_forced;
unsigned long retries;
int (*set_state_periodic)(struct clock_event_device *);
int (*set_state_oneshot)(struct clock_event_device *);
int (*set_state_oneshot_stopped)(struct clock_event_device *);
int (*set_state_shutdown)(struct clock_event_device *);
int (*tick_resume)(struct clock_event_device *);
void (*broadcast)(const struct cpumask *mask);
void (*suspend)(struct clock_event_device *);
void (*resume)(struct clock_event_device *);
unsigned long min_delta_ticks;
unsigned long max_delta_ticks;
const char *name;
int rating;
int irq;
int bound_on;
const struct cpumask *cpumask;
struct list_head list;
struct module *owner;
};
๐ซถ Members ๐ซถ
okay bestie, member-by-member time. this is giving documentation but make it cute ๐ธ
event_handlerโ the framework assigns this one, and the low level handler of the event source calls it. assigned-by-the-framework realness ๐set_next_eventโ set next event function using a clocksource delta โจset_next_ktimeโ set next event function using a direct ktime value ๐ฐ๏ธset_next_coupledโ set next event function for clocksource coupled mode ๐next_eventโ local storage for the next event in oneshot mode ๐ฆmax_delta_nsโ maximum delta value in ns, highkey important ๐ฅmin_delta_nsโ minimum delta value in ns, also important ๐multโ nanosecond to cycles multiplier ๐งฎshiftโ nanoseconds to cycles divisor, and itโs a power of two, bestie โกstate_use_accessorsโ current state of the device, assigned by the core code ๐featuresโ the description is literally just โfeaturesโ, bestie. thatโs the whole thing, and I respect the brevity ๐ญcs_idโ Clocksource ID to denote the clocksource for coupled mode ๐next_event_forcedโ True if the last programming was a forced event ๐ฅretriesโ number of forced programming retries ๐set_state_periodicโ switch state to periodic ๐set_state_oneshotโ switch state to oneshot ๐ฏset_state_oneshot_stoppedโ switch state to oneshot_stopped ๐set_state_shutdownโ switch state to shutdown ๐tick_resumeโ resume clkevt device โถ๏ธbroadcastโ function to broadcast events ๐ฃsuspendโ itโs in the struct above, but the Members blurbs donโt give it a separate description, so Iโm not inventing one ๐ซresumeโ same energy: struct field, no separate Members description, no cap ๐min_delta_ticksโ minimum delta value in ticks stored for reconfiguration ๐max_delta_ticksโ maximum delta value in ticks stored for reconfiguration ๐nameโ ptr to clock event name ๐ท๏ธratingโ variable to rate clock event devices โญirqโ IRQ number, only for non CPU local devices ๐จbound_onโ Bound on CPU ๐cpumaskโ cpumask to indicate for which CPUs this device works ๐งlistโ list head for the management code ๐ownerโ module reference, gotta keep that module ref, periodt ๐ซถ
๐ SEE ALSO ๐
- Kernel file
./include/linux/clockchips.hโ go peek, bestie ๐ฆ
and thatโs the page! ๐ this one lives under ./include/linux, dated October 2026, and itโs the struct clock_event_device(9) manual page โ mwah ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms