cpufreq_get_cur_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 an unsigned 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 πŸ¦‹

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