drivers/vfio/cdx/intr.c
Source file repositories/reference/linux-study-clean/drivers/vfio/cdx/intr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/vfio/cdx/intr.c- Extension
.c- Size
- 4810 bytes
- Lines
- 216
- Domain
- Driver Families
- Bucket
- drivers/vfio
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/vfio.hlinux/slab.hlinux/types.hlinux/eventfd.hlinux/msi.hlinux/interrupt.hlinux/cdx/cdx_bus.hprivate.h
Detected Declarations
function Copyrightfunction vfio_cdx_msi_enablefunction vfio_cdx_msi_set_vector_signalfunction vfio_cdx_msi_set_blockfunction vfio_cdx_msi_disablefunction vfio_cdx_set_msi_triggerfunction vfio_cdx_set_irqs_ioctlfunction vfio_cdx_irqs_cleanup
Annotated Snippet
if (flags & VFIO_IRQ_SET_DATA_NONE) {
eventfd_signal(vdev->cdx_irqs[i].trigger);
} else if (flags & VFIO_IRQ_SET_DATA_BOOL) {
u8 *bools = data;
if (bools[i - start])
eventfd_signal(vdev->cdx_irqs[i].trigger);
}
}
return 0;
}
int vfio_cdx_set_irqs_ioctl(struct vfio_cdx_device *vdev,
u32 flags, unsigned int index,
unsigned int start, unsigned int count,
void *data)
{
if (flags & VFIO_IRQ_SET_ACTION_TRIGGER)
return vfio_cdx_set_msi_trigger(vdev, index, start,
count, flags, data);
else
return -EINVAL;
}
/* Free All IRQs for the given device */
void vfio_cdx_irqs_cleanup(struct vfio_cdx_device *vdev)
{
vfio_cdx_set_msi_trigger(vdev, 0, 0, 0, VFIO_IRQ_SET_DATA_NONE, NULL);
}
Annotation
- Immediate include surface: `linux/vfio.h`, `linux/slab.h`, `linux/types.h`, `linux/eventfd.h`, `linux/msi.h`, `linux/interrupt.h`, `linux/cdx/cdx_bus.h`, `private.h`.
- Detected declarations: `function Copyright`, `function vfio_cdx_msi_enable`, `function vfio_cdx_msi_set_vector_signal`, `function vfio_cdx_msi_set_block`, `function vfio_cdx_msi_disable`, `function vfio_cdx_set_msi_trigger`, `function vfio_cdx_set_irqs_ioctl`, `function vfio_cdx_irqs_cleanup`.
- Atlas domain: Driver Families / drivers/vfio.
- 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.