STRUCT POWERCAP_CONTROL_TYPE(9)
π«Ά struct powercap_control_type β the powercap control_type, explained π«Ά
okay so real talk, this is a page from the Kernel API Manual, and it's all about struct powercap_control_type. it's like a little container gremlin that holds your power zones together. ngl it's giving "quiet main character" energy β it does a lot but it's literally all private. let's get into it π
β¨ NAME β¨
struct powercap_control_type β the struct that defines a powercap control_type, periodt.
π¦ SYNOPSIS π¦
struct powercap_control_type {
struct device dev;
struct idr idr;
int nr_zones;
const struct powercap_control_type_ops *ops;
struct mutex lock;
bool allocated;
struct list_head node;
};
π Members π
okay bestie, here's the field-by-field vibe check π
devβ the device for this control_type. that's its whole thing πidrβ the idr that hands out a unique id to each of its children. one id per kid, no duplicates, slay π₯nr_zonesβ a counter for how many zones this type has. it's literally keeping count πopsβ a pointer to the callback struct. the plug-in point for behavior β¨lockβ the mutex for the control type. mutual exclusion, we love a protective queen πallocatedβ okay so this one's a whole situation: it's possible that the client owns the memory used by this structure. in that case, the framework sets this flag tofalseto prevent deallocation during the release process. otherwise this flag is set totrue. so like,false= hands off, the client's got the memory;true= framework's memory, framework's problem π«Άnodeβ the linked-list node. it's on a list, living its list life πΈ
π Description π
so this struct defines a powercap control_type β it acts as a container for power zones that all use the same method to control power. examples being RAPL, RAPL-PCI, etc. π§
β οΈ heads up bestie: all fields are private and should not be used by client drivers. like, hands off the merch. the framework handles it, you don't π
π SEE ALSO π
- The kernel file
./include/linux/powercap.hβstruct powercap_control_type_ops(9)struct powercap_zone_ops(9)struct powercap_zone(9)struct powercap_zone_constraint_ops(9)struct powercap_zone_constraint(9)powercap_set_zone_data(9)powercap_get_zone_data(9)powercap_register_control_type(9)powercap_unregister_control_type(9)powercap_register_zone(9)powercap_unregister_zone(9)
and that's the whole page, bestie β you ate that π β¨
π cute little sign-off: this one lives at./include/linux, dated October 2026, and it's brought to you bystruct power...control_type(9)β yes that's literally the abbreviated name, truncated and iconic. iykyk π
π¦ 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