dw_apb_clocksource_init(9)
π dw_apb_clocksource_init(9) β from the Kernel API Manual, bestie
okay so picture this: you've got an APB timer sitting there, all cute and ticking, and you want the kernel to actually use it as a clocksource. That's literally what this function is for. Let's get into it β¨
πΈ SYNOPSIS πΈ
struct dw_apb_clocksource * dw_apb_clocksource_init (unsigned rating ,
const char *name , void __iomem *base , unsigned long freq );
She returns a struct dw_apb_clocksource *, no cap. Four arguments, all of them mandatory, so don't even think about skipping any π«Ά
π ARGUMENTS π
ratingβ the rating you're giving this clocksource. It's anunsigned. Yes, the kernel ranks its clocksources, and yes, this is how you tell it how much you believe in this timer.nameβ the name for the clocksource.const char *. Give her a name, she deserves one πbaseβ the I/O base for the timer registers. Type isvoid __iomem *, i.e. one of those memory-mapped I/O pointers, don't just yeet a normal pointer in there.freqβ the frequency that the timer counts at, as anunsigned long. Know your tick rate, bestie.
π¦ DESCRIPTION π¦
So what this does: it creates a clocksource using an APB timer β but it does not yet register it with the clocksource system. That's the important bit, okay? She's built, she's not deployed.
Not me making a clocksource and then forgetting the second step π The next step is dw_apb_clocksource_register. Do it. Don't leave her hanging.
So the whole flow is: dw_apb_clocksource_init first, then dw_apb_clocksource_register as the next step. Periodt π
π SEE ALSO π
- Kernel file
./drivers/clocksource/dw_apb_timer.c dw_apb_clockevent_init(9)dw_apb_clockevent_register(9)dw_apb_clocksource_start(9)dw_apb_clocksource_register(9)dw_apb_clocksource_read(9)
π sign-off π
This little gem lives in ./drivers/clocksource, dated October 2026, and the whole page is served up under the dw_apb_clocksource_init(9) header from the Kernel API Manual. Go forth and init your timers, bestie β and then register them π§π
π¦ 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