STRUCT PSTATE_FUNCS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to the Kernel API Manual β€” and buckle up, because this one is struct pstate_funcs β€” literally Per CPU model specific callbacks. that's the whole vibe. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

here's the struct in all its glory, copy-pasted with love so you don't mess up a single character:

struct pstate_funcs {
    int (*get_max)(int cpu);
    int (*get_max_physical)(int cpu);
    int (*get_min)(int cpu);
    int (*get_turbo)(int cpu);
    int (*get_scaling)(void);
    int (*get_cpu_scaling)(int cpu);
    int (*get_aperf_mperf_shift)(void);
    u64 (*get_val)(struct cpudata*, int pstate);
    void (*get_vid)(struct cpudata *);
 };

πŸ’… Members πŸ’…

like, one cute little callback for everything. a whole squad of function pointers, fr fr:

  • get_max β€” the callback that fetches the maximum non turbo effective P state 🫢
  • get_max_physical β€” the callback that fetches the maximum non turbo physical P state (yes, physical, she's different from get_max, no cap) πŸ”₯
  • get_min β€” the callback that fetches the minimum P state 🧚
  • get_turbo β€” the callback that fetches the turbo P state ⚑
  • get_scaling β€” the callback that fetches the frequency scaling factor 🌸
  • get_cpu_scaling β€” gets the frequency scaling factor, but like, for a given cpu β€” int cpu babe πŸ’–
  • get_aperf_mperf_shift β€” the callback that fetches the APERF vs MPERF frequency difference πŸ‘€
  • get_val β€” the callback that converts a P state into the actual MSR write value ✨
  • get_vid β€” the callback that gets VID data for Atom platforms πŸ¦‹

🌈 Description 🌈

so here's the tea: Core and Atom CPU models have different ways to get P State limits. this structure is literally just the storage unit for those callbacks β€” one struct, both worlds, main character energy. πŸ’€πŸ’–


⭐ SEE ALSO ⭐

go look at the kernel file ./drivers/cpufreq/intel_pstate.c, and also these absolute icons:

  • struct sample(9)
  • struct pstate_data(9)
  • struct vid_data(9)
  • struct global_params(9)
  • struct cpudata(9)

iykyk πŸ’œ


and that's the whole page, bestie β€” mwah πŸ˜­πŸ’…

source lives at ./drivers/cpufreq, dated October 2026. periodt. πŸŽ€πŸ«Ά
πŸ“¦ where this page comes from