get_resource(9)
π NAME π
okay so we're in the Kernel API Manual, bestie, and this page is get_resource(9) β it's literally the function that finds a resource of the size you asked for and splits up the bigger ones. π
β¨ SYNOPSIS β¨
struct pci_resource * get_resource (struct pci_resource **head , u32
size );
π ARGUMENTS π
headβ the list you're searching through for resources, bestie.sizeβ the size limit to use. π
π¦ DESCRIPTION π¦
okay so here's the tea: this function sorts the resource list by size, then returns the first node of "size" length. If it finds a node that's larger than "size", it will split it up. βοΈβ¨
π¨ bestie, "size" must be a power of two. Like, that's the rule. No cap. π
π SEE ALSO π
Kernel file ./drivers/pci/hotplug/cpqphp_ctrl.c is the main-character file for this one, and the whole friend group is:
cpqhp_find_slot(9)sort_by_size(9)sort_by_max_size(9)do_pre_bridge_resource_split(9)do_bridge_resource_split(9)get_io_resource(9)get_max_resource(9)cpqhp_resource_sort_and_combine(9)cpqhp_slot_create(9)slot_remove(9)bridge_slot_remove(9)cpqhp_slot_find(9)set_controller_speed(9)board_replaced(9)board_added(9)remove_board(9)cpqhp_pushbutton_thread(9)switch_leds(9)cpqhp_hardware_test(9)configure_new_device(9)configure_new_function(9)
mwah π β this page is sourced from ./drivers/pci/hotplug and dated October 2026, page get_resource(9). byeee bestie π«Άβ¨
π¦ 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