cpufreq_get_cur_state(9)
π cpufreq_get_cur_state(9) β¨
okay bestie, so this is a page from the Kernel API Manual β yes, the kernel, yes, the big one β and it's all about cpufreq_get_cur_state. It's a callback function that gets the current cooling state. that's literally the whole vibe. π§
π SYNOPSIS π
int cpufreq_get_cur_state (struct thermal_cooling_device *cdev ,
unsigned long *state );
two arguments, one int coming back at you. that's the whole signature, no cap. β¨
πΈ ARGUMENTS πΈ
cdevβ the thermal cooling device pointer. like, the actual device you're asking about. π«Άstateβ you fill this variable with the current cooling state. it's anunsigned long *, so yes, you're writing through a pointer, bestie, be normal about it. βοΈ
π DESCRIPTION π
so this is the callback for the thermal cooling device β its whole job is to hand back the cpufreq current cooling state. the thermal side knocks, this function answers. that's the gig. it's giving "reliable friend who always picks up the phone." π
π₯ RETURN π₯
0 on success. and like β this function doesn't fail. at all. literally cannot flop. returns 0, done, periodt. πβ¨
π¦ SEE ALSO π¦
- Kernel file
./drivers/thermal/cpufreq_cooling.c struct time_in_idle(9)struct cpufreq_cooling_device(9)get_level(9)get_load(9)get_dynamic_power(9)cpufreq_get_requested_power(9)cpufreq_state2power(9)cpufreq_power2state(9)cpufreq_get_max_state(9)cpufreq_set_cur_state(9)__cpufreq_cooling_register(9)cpufreq_cooling_register(9)of_cpufreq_cooling_register(9)cpufreq_cooling_unregister(9)
like, go read the whole friend group, they all hang out in the same file. iykyk π
ngl this one's short and sweet β no warnings, no gotchas, no deprecated anything. just a chill little callback doing its one job. main character energy, honestly. π
mwah π this page lives in ./drivers/thermal, and this drop is dated October 2026 β so like, future-coded of it. go be smart with it bestie, ily, bye!! π¦ππ
π¦ 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