msi_device_..._alloc_wired(9)
π msi_device_..._alloc_wired(9) π
okay so bestie, welcome to the Kernel API Manual β yes we're reading kernel docs together, that's the vibe now, and honestly? iconic of us. this one lives at msi_device_..._alloc_wired(9) and it's all about allocating a "wired" interrupt on @domain. let's get into it β¨
πΈ NAME πΈ
msi_device_domain_alloc_wired β allocate a "wired" interrupt on @domain, fr fr π«Ά
β¨ SYNOPSIS β¨
int msi_device_domain_alloc_wired (struct irq_domain *domain , unsigned
int hwirq , unsigned int type );
like, that's the whole signature, no notes π
π ARGUMENTS π
domainβ the domain we're allocating on, the main character of this function π¦hwirqβ the hardware interrupt number we're allocating for, iykyk π₯typeβ the interrupt type, that's it, that's the whole thing π
π DESCRIPTION π
so this weirdness is here to support wire to MSI controllers like MBIGEN. and when I say weirdness, bestie, I mean it π
hwirq is the hardware interrupt number, and it gets handed in from irq_create_fwspec_mapping. here's the situation: the wire to MSI domain is sparse, but it's sized in firmware. so the hardware interrupt number literally cannot be used as the MSI index. like, it's just not that girl π
for the underlying irq chip though? the MSI index is irrelevant β all it actually needs is the hardware interrupt number. periodt.
so to handle all of this, the MSI index gets allocated with MSI_ANY_INDEX, and the hardware interrupt number is stored along with the type information in msi_desc::cookie. that way the underlying interrupt chip and the domain code can retrieve it later. slay π
β RETURN β
the Linux interrupt number (> 0) or an error code. simple as that, no cap π«Ά
π¦ SEE ALSO π¦
bestie there are so many of these and I'm obsessed with the list, look at her go:
Kernel file ./kernel/irq/msi.c, then struct msi_device_data(9), struct msi_ctrl(9), msi_alloc_desc(9), msi_domain_insert_msi_desc(9), msi_domain_free_msi_descs_range(9), msi_domain_add_simple_msi_descs(9), msi_setup_device_data(9), __msi_lock_descs(9), __msi_unlock_descs(9), msi_domain_first_desc(9), msi_next_desc(9), msi_domain_get_virq(9), msi_device_populate_sysfs(9), msi_device_destroy_sysfs(9), msi_domain_set_affinity(9), msi_create_irq_domain(9), msi_create_parent_irq_domain(9), msi_parent_init_dev_msi_info(9), msi_create_device_irq_domain(9), msi_remove_device_irq_domain(9), msi_match_device_irq_domain(9), msi_domain_alloc_irqs_range_locked(9), msi_domain_alloc_irqs_range(9), msi_domain_alloc_irqs_all_locked(9), msi_domain_alloc_irq_at(9), msi_domain_free_irqs_range_locked(9), msi_domain_free_irqs_range(9), msi_domain_free_irqs_all_locked(9), msi_domain_free_irqs_all(9), msi_device_domain_free_wired(9), msi_get_domain_info(9), msi_device_has_isolated_msi(9) π
and that's the page, bestie!! before I dip: this little masterpiece comes from ./kernel/irq, dated October 2026, and the manual header is msi_device_..._alloc_wired(9) from the Kernel API Manual. mwah, study hard, drink water, and may your interrupts always be wired correctly πβ¨π
π¦ 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