Ejemplo n.º 1
0
static void
ioapic_abi_msi_map(int intr, uint64_t *addr, uint32_t *data, int cpuid)
{
	const struct ioapic_irqmap *map;

	KASSERT(cpuid >= 0 && cpuid < ncpus,
	    ("invalid cpuid %d", cpuid));

	KASSERT(intr >= 0 && intr < IOAPIC_HWI_VECTORS,
	    ("invalid intr %d\n", intr));

	lwkt_gettoken(&ioapic_irqmap_tok);

	map = &ioapic_irqmaps[cpuid][intr];
	KASSERT(map->im_type == IOAPIC_IMT_MSI ||
	    map->im_type == IOAPIC_IMT_MSIX,
	    ("try map non-MSI/MSI-X intr %d, type %d\n", intr, map->im_type));
	KASSERT(map->im_msi_base >= 0 && map->im_msi_base <= intr,
	    ("intr %d, invalid %s-base %d\n", intr,
	     map->im_type == IOAPIC_IMT_MSI ? "MSI" : "MSI-X",
	     map->im_msi_base));

	msi_map(map->im_msi_base, addr, data, cpuid);

	if (bootverbose) {
		kprintf("map %s intr %d on cpu%d\n",
		    map->im_type == IOAPIC_IMT_MSI ? "MSI" : "MSI-X",
		    intr, cpuid);
	}

	lwkt_reltoken(&ioapic_irqmap_tok);
}
Ejemplo n.º 2
0
static int
nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data)
{

	return (msi_map(irq, addr, data));
}