include/linux/msi.h
Source file repositories/reference/linux-study-clean/include/linux/msi.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/msi.h- Extension
.h- Size
- 24484 bytes
- Lines
- 720
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irqdomain_defs.hlinux/cpumask_types.hlinux/msi_api.hlinux/irq.hasm/msi.hlinux/irqhandler.h
Detected Declarations
struct msi_msgstruct msi_descstruct pci_devstruct device_attributestruct irq_domainstruct irq_affinity_descstruct pci_msi_descstruct msi_desc_datastruct msi_descstruct msi_dev_domainstruct irq_domainstruct irq_domain_opsstruct irq_chipstruct irq_fwspecstruct device_nodestruct fwnode_handlestruct msi_domain_infostruct msi_domain_opsstruct msi_domain_infostruct msi_domain_templatestruct msi_parent_opsstruct irq_domain_infoenum msi_desc_filterfunction get_cached_msi_msgfunction msi_desc_set_iommu_msi_iovafunction msi_msg_set_addrfunction msi_insert_msi_descfunction msi_free_msi_descs_rangefunction msi_free_msi_descsfunction msi_device_populate_sysfsfunction msi_device_destroy_sysfsfunction msi_domain_alloc_irqsfunction msi_device_has_isolated_msifunction pci_write_msi_msg
Annotated Snippet
struct msi_msg {
union {
u32 address_lo;
arch_msi_msg_addr_lo_t arch_addr_lo;
};
union {
u32 address_hi;
arch_msi_msg_addr_hi_t arch_addr_hi;
};
union {
u32 data;
arch_msi_msg_data_t arch_data;
};
};
/* Helper functions */
struct msi_desc;
struct pci_dev;
struct device_attribute;
struct irq_domain;
struct irq_affinity_desc;
void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
#ifdef CONFIG_GENERIC_MSI_IRQ
void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
#else
static inline void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg) { }
#endif
typedef void (*irq_write_msi_msg_t)(struct msi_desc *desc,
struct msi_msg *msg);
/**
* struct pci_msi_desc - PCI/MSI specific MSI descriptor data
*
* @msi_mask: [PCI MSI] MSI cached mask bits
* @msix_ctrl: [PCI MSI-X] MSI-X cached per vector control bits
* @is_msix: [PCI MSI/X] True if MSI-X
* @multiple: [PCI MSI/X] log2 num of messages allocated
* @multi_cap: [PCI MSI/X] log2 num of messages supported
* @can_mask: [PCI MSI/X] Masking supported?
* @is_64: [PCI MSI/X] Address size: 0=32bit 1=64bit
* @default_irq:[PCI MSI/X] The default pre-assigned non-MSI irq
* @msi_attrib: [PCI MSI/X] Compound struct of MSI/X attributes
* @mask_pos: [PCI MSI] Mask register position
* @mask_base: [PCI MSI-X] Mask register base address
*/
struct pci_msi_desc {
union {
u32 msi_mask;
u32 msix_ctrl;
};
struct {
u8 is_msix : 1;
u8 multiple : 3;
u8 multi_cap : 3;
u8 can_mask : 1;
u8 is_64 : 1;
u8 is_virtual : 1;
unsigned default_irq;
} msi_attrib;
union {
u8 mask_pos;
void __iomem *mask_base;
};
};
/**
* union msi_domain_cookie - Opaque MSI domain specific data
* @value: u64 value store
* @ptr: Pointer to domain specific data
* @iobase: Domain specific IOmem pointer
*
* The content of this data is implementation defined and used by the MSI
* domain to store domain specific information which is requried for
* interrupt chip callbacks.
*/
union msi_domain_cookie {
u64 value;
void *ptr;
void __iomem *iobase;
};
/**
* struct msi_desc_data - Generic MSI descriptor data
* @dcookie: Cookie for MSI domain specific data which is required
* for irq_chip callbacks
* @icookie: Cookie for the MSI interrupt instance provided by
* the usage site to the allocation function
*
Annotation
- Immediate include surface: `linux/irqdomain_defs.h`, `linux/cpumask_types.h`, `linux/msi_api.h`, `linux/irq.h`, `asm/msi.h`, `linux/irqhandler.h`.
- Detected declarations: `struct msi_msg`, `struct msi_desc`, `struct pci_dev`, `struct device_attribute`, `struct irq_domain`, `struct irq_affinity_desc`, `struct pci_msi_desc`, `struct msi_desc_data`, `struct msi_desc`, `struct msi_dev_domain`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.