clocksource_khz2mult(9)
π clocksource_khz2mult(9)
okay so bestie, welcome to the Kernel API Manual β yes, that's the whole vibe, and honestly? We're slaying in the kernel today β¨ This one's a tiny little helper in ./include/linux/clocksource.h-land and it's literally the glow-up your khz frequency never knew it needed π
πΈ NAME πΈ
clocksource_khz2mult β calculates mult from khz and shift π
Like, that's it. That's the whole job. It takes your frequency in kHz and your shift factor and hands you back a multiplier. No cap β¨
π¦ SYNOPSIS π¦
u32 clocksource_khz2mult (u32 khz , u32 shift_constant );
π ARGUMENTS π
khzβ your Clocksource frequency in KHz, bestie π This is the actual number we're mathing on.shift_constantβ the Clocksource shift factor β¨ the how-much-are-we-shifting-by of it all.
π DESCRIPTION π
So the way this works: these are helper functions that convert a khz counter frequency into a clocksource multiplier π And you don't just do that in the void β nah, you do it given the clocksource shift value π So like, khz + shift_constant in, mult out. Iconic behaviour, truly π§
it's a helper function, so it's not out here being a main character β it's the supportive bestie to the bigger clocksource machinery π«Ά
π SEE ALSO π
- Kernel file
./include/linux/clocksource.hstruct clocksource_hw_snapshot(9)struct clocksource(9)clocksource_hz2mult(9)clocksource_cyc2ns(9)struct clocksource_base(9)
and that's the whole page, bestie!! π
cute lil sign-off: this came from the source at ./include/linux and it's dated October 2026 πΈ mwah, go convert some frequencies responsibly ππ
π¦ 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