STRUCT PSTATE_FUNCS(9)
β¨ 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 fromget_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 cpubabe π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
- 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