dw_apb_clocksource_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 an unsigned. 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 is void __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 an unsigned 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 πŸ‘‘


🌈 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