FreeBSD/sys/x86/xen/xen_intr.c
/*
 * Enable and unmask the interrupt source.
 *
 * \param isrc  The interrupt source to enable.
 */
Enable and unmask the interrupt source.
\param isrc  The interrupt source to enable.
Enable and unmask the interrupt source . \ param isrc The interrupt source to enable .
static void
xen_intr_pirq_enable_intr(struct intsrc *base_isrc)
{
	struct xenisrc *isrc;
	struct evtchn_bind_pirq bind_pirq;
	struct physdev_irq_status_query irq_status;
	int error;
	isrc = (struct xenisrc *)base_isrc;
	if (!xen_intr_pirq_eoi_map_enabled) {
		irq_status.irq = isrc->xi_pirq;
		error = HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query,
		    &irq_status);
		if (error)
			panic("unable to get status of IRQ#%d", isrc->xi_pirq);
		if (irq_status.flags & XENIRQSTAT_needs_eoi) {
			xen_set_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map);
		}
	}
	bind_pirq.pirq = isrc->xi_pirq;
	bind_pirq.flags = isrc->xi_edgetrigger ? 0 : BIND_PIRQ__WILL_SHARE;
	error = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
	if (error)
		panic("unable to bind IRQ#%d", isrc->xi_pirq);
	isrc->xi_port = bind_pirq.port;
	mtx_lock(&xen_intr_isrc_lock);
	KASSERT((xen_intr_port_to_isrc[bind_pirq.port] == NULL),
	    ("trying to override an already setup event channel port"));
	xen_intr_port_to_isrc[bind_pirq.port] = isrc;
	mtx_unlock(&xen_intr_isrc_lock);
	evtchn_unmask_port(isrc->xi_port);
}
static void xen_intr_pirq_enable_intr ( struct intsrc * base_isrc ) { struct xenisrc * isrc ; struct evtchn_bind_pirq bind_pirq ; struct physdev_irq_status_query irq_status ; int error ; isrc = ( struct xenisrc * ) base_isrc ; if ( ! xen_intr_pirq_eoi_map_enabled ) { irq_status . irq = isrc -> xi_pirq ; error = HYPERVISOR_physdev_op ( PHYSDEVOP_irq_status_query , & irq_status ) ; if ( error ) panic ( " " , isrc -> xi_pirq ) ; if ( irq_status . flags & XENIRQSTAT_needs_eoi ) { xen_set_bit ( isrc -> xi_pirq , xen_intr_pirq_eoi_map ) ; } } bind_pirq . pirq = isrc -> xi_pirq ; bind_pirq . flags = isrc -> xi_edgetrigger ? 0 : BIND_PIRQ__WILL_SHARE ; error = HYPERVISOR_event_channel_op ( EVTCHNOP_bind_pirq , & bind_pirq ) ; if ( error ) panic ( " " , isrc -> xi_pirq ) ; isrc -> xi_port = bind_pirq . port ; mtx_lock ( & xen_intr_isrc_lock ) ; KASSERT ( ( xen_intr_port_to_isrc [ bind_pirq . port ] == NULL ) , ( " " ) ) ; xen_intr_port_to_isrc [ bind_pirq . port ] = isrc ; mtx_unlock ( & xen_intr_isrc_lock ) ; evtchn_unmask_port ( isrc -> xi_port ) ; }
Enable and unmask the interrupt source.
Enable and unmask the interrupt source .
/*
			 * Since the dynamic PIRQ EOI map is not available
			 * mark the PIRQ as needing EOI unconditionally.
			 */