__irq_domain_alloc_irqs(9)
π
__irq_domain_alloc_irqs (9) β Kernel API Manual β¨
okay bestie, welcome to the Kernel API Manual page for __irq_domain_alloc_irqs β yes that's a lot of underscores, no we're not scared, she's iconic π
πΈ NAME πΈ
__irq_domain_alloc_irqs β literally just Allocate IRQs from domain. that's it. that's the job. π
π¦ SYNOPSIS π¦
int __irq_domain_alloc_irqs (struct irq_domain *domain , int irq_base ,
unsigned int nr_irqs , int node , void *arg , bool realloc , const
struct irq_affinity_desc *affinity );
seven args. seven. she's high-maintenance but she delivers π«Ά
β¨ ARGUMENTS β¨
domainβ the domain you're allocating from, aka the vibe source πirq_baseβ if it's>= 0, allocate that specific IRQ number, like reserving the exact seat you want fr frnr_irqsβ how many IRQs you want. count them. actually count them πnodeβ the NUMA node id, for the memory allocation π§argβ domain-specific argument, the little mystery bag each domain gets to define itself πreallocβ iftrue, the IRQ descriptors have already been allocated, so we're re-allocating, not allocating fresh πaffinityβ optional IRQ affinity mask for multiqueue devices. optional, but a lot of devices are obsessed with it β
π DESCRIPTION π
so what she does: allocates IRQ numbers and initializes all the data structures needed to support hierarchy IRQ domains. all of them. the whole scaffolding π
the realloc parameter is lowkey mainly there to support legacy IRQs β not her main character era, but she shows up for the old heads π
she returns an error code or the allocated IRQ number. so like, check your return value. always. ngl this is the vibe check of the whole function π₯
and here's the part that's giving β¨ architecture β¨ β the whole process of setting up an IRQ has been split into two steps:
__irq_domain_alloc_irqsβ the first step, allocating the IRQ descriptor and the required hardware resources πΈirq_domain_activate_irqβ the second step, programming the hardware with those preallocated resources π¦
and why are we splitting it, you ask? because it makes it easier to rollback when failing to allocate resources. she plans ahead. she has an exit strategy. main character energy fr fr π
ngl the two-step thing is the whole point β allocate first, program hardware second, so a failure doesn't leave you scrambling π
π SEE ALSO π
kernel file ./kernel/irq/irqdomain.c π and honestly the whole friend group:
__irq_domain_alloc_fwnode(9)irq_domain_free_fwnode(9)irq_domain_instantiate(9)irq_domain_remove(9)irq_domain_create_simple(9)irq_find_matching_fwspec(9)irq_set_default_domain(9)irq_get_default_domain(9)irq_create_direct_mapping(9)irq_create_mapping_affinity(9)irq_dispose_mapping(9)__irq_resolve_mapping(9)irq_domain_xlate_onecell(9)irq_domain_xlate_twocell(9)irq_domain_xlate_twothreecell(9)irq_domain_xlate_onetwocell(9)irq_domain_translate_onecell(9)irq_domain_translate_twocell(9)irq_domain_translate_twothreecell(9)irq_domain_reset_irq_data(9)irq_domain_disconnect_hierarchy(9)irq_domain_get_irq_data(9)irq_domain_set_hwirq_and_chip(9)irq_domain_set_info(9)irq_domain_free_irqs_common(9)irq_domain_free_irqs_top(9)irq_domain_push_irq(9)irq_domain_pop_irq(9)irq_domain_free_irqs(9)irq_domain_alloc_irqs_parent(9)irq_domain_free_irqs_parent(9)irq_domain_activate_irq(9)irq_domain_deactivate_irq(9)
okay that's the page!! π«Ά sign-off time: this lil masterpiece lives in the ./kernel/irq source tree, dated October 2026, and it's page __irq_domain_alloc_irqs(9) of the Kernel API Manual β go allocate responsibly bestie, and check that return value πβ¨π
π¦ 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