MCPcopy Create free account
hub / github.com/F-Stack/f-stack / intr_map_irq

Function intr_map_irq

freebsd/kern/subr_intr.c:1662–1689  ·  view source on GitHub ↗

* Allocate and fill new entry in irq_map table. */

Source from the content-addressed store, hash-verified

1660 * Allocate and fill new entry in irq_map table.
1661 */
1662u_int
1663intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data)
1664{
1665 u_int i;
1666 struct intr_map_entry *entry;
1667
1668 /* Prepare new entry first. */
1669 entry = malloc(sizeof(*entry), M_INTRNG, M_WAITOK | M_ZERO);
1670
1671 entry->dev = dev;
1672 entry->xref = xref;
1673 entry->map_data = data;
1674 entry->isrc = NULL;
1675
1676 mtx_lock(&irq_map_lock);
1677 for (i = irq_map_first_free_idx; i < irq_map_count; i++) {
1678 if (irq_map[i] == NULL) {
1679 irq_map[i] = entry;
1680 irq_map_first_free_idx = i + 1;
1681 mtx_unlock(&irq_map_lock);
1682 return (i);
1683 }
1684 }
1685 mtx_unlock(&irq_map_lock);
1686
1687 /* XXX Expand irq_map table */
1688 panic("IRQ mapping table is full.");
1689}
1690
1691/*
1692 * Remove and free mapping entry.

Callers 9

mips_pic_map_fixed_intrFunction · 0.85
nexus_ofw_map_intrFunction · 0.85
bhnd_nexus_map_intrFunction · 0.85
nexus_ofw_map_intrFunction · 0.85
nexus_acpi_map_intrFunction · 0.85
nexus_ofw_map_intrFunction · 0.85
intr_alloc_msiFunction · 0.85
intr_alloc_msixFunction · 0.85
intr_map_clone_irqFunction · 0.85

Calls 4

mallocFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
panicFunction · 0.70

Tested by

no test coverage detected