FreeBSD/sys/x86/xen/xen_msi.c
/*
 * Try to allocate 'count' interrupt sources with contiguous IDT values.
 */
Try to allocate 'count' interrupt sources with contiguous IDT values.
Try to allocate ' count ' interrupt sources with contiguous IDT values .
int
xen_msi_alloc(device_t dev, int count, int maxcount, int *irqs)
{
	int i, ret = 0;
	mtx_lock(&msi_lock);
	if ((msi_last_irq + count) > NUM_MSI_INTS) {
		mtx_unlock(&msi_lock);
		return (ENXIO);
	}
	for (i = 0; i < count; i++)
		irqs[i] = FIRST_MSI_INT + msi_last_irq++;
	mtx_unlock(&msi_lock);
	ret = xen_register_msi(dev, irqs[0], count);
	if (ret != 0)
		return (ret);
	for (i = 0; i < count; i++)
		nexus_add_irq(irqs[i]);
	return (0);
}
int xen_msi_alloc ( device_t dev , int count , int maxcount , int * irqs ) { int i , ret = 0 ; mtx_lock ( & msi_lock ) ; if ( ( msi_last_irq + count ) > NUM_MSI_INTS ) { mtx_unlock ( & msi_lock ) ; return ( ENXIO ) ; } for ( i = 0 ; i < count ; i ++ ) irqs [ i ] = FIRST_MSI_INT + msi_last_irq ++ ; mtx_unlock ( & msi_lock ) ; ret = xen_register_msi ( dev , irqs [ 0 ] , count ) ; if ( ret != 0 ) return ( ret ) ; for ( i = 0 ; i < count ; i ++ ) nexus_add_irq ( irqs [ i ] ) ; return ( 0 ) ; }
Try to allocate 'count' interrupt sources with contiguous IDT values.
Try to allocate ' count ' interrupt sources with contiguous IDT values .
/* If we would exceed the max, give up. */ /* Allocate MSI vectors */