FreeBSD/sys/x86/xen/xen_intr.c
/**
 * Return this PIC to service after being suspended.
 */
Return this PIC to service after being suspended.
Return this PIC to service after being suspended .
static void
xen_intr_resume(struct pic *unused, bool suspend_cancelled)
{
	shared_info_t *s = HYPERVISOR_shared_info;
	struct xenisrc *isrc;
	u_int isrc_idx;
	int i;
	if (suspend_cancelled)
		return;
	CPU_FOREACH(i) {
		struct xen_intr_pcpu_data *pcpu;
		pcpu = DPCPU_ID_PTR(i, xen_intr_pcpu);
		memset(pcpu->evtchn_enabled, i == 0 ? ~0 : 0,
		    sizeof(pcpu->evtchn_enabled));
	}
	for (i = 0; i < nitems(s->evtchn_mask); i++)
		atomic_store_rel_long(&s->evtchn_mask[i], ~0);
	memset(xen_intr_port_to_isrc, 0, sizeof(xen_intr_port_to_isrc));
	for (isrc_idx = 0; isrc_idx < xen_intr_auto_vector_count; isrc_idx++) {
		u_int vector;
		vector = FIRST_EVTCHN_INT + isrc_idx;
		isrc = (struct xenisrc *)intr_lookup_source(vector);
		if (isrc != NULL) {
			isrc->xi_port = 0;
			switch (isrc->xi_type) {
			case EVTCHN_TYPE_IPI:
				xen_rebind_ipi(isrc);
				break;
			case EVTCHN_TYPE_VIRQ:
				xen_rebind_virq(isrc);
				break;
			default:
				break;
			}
		}
	}
}
static void xen_intr_resume ( struct pic * unused , bool suspend_cancelled ) { shared_info_t * s = HYPERVISOR_shared_info ; struct xenisrc * isrc ; u_int isrc_idx ; int i ; if ( suspend_cancelled ) return ; CPU_FOREACH ( i ) { struct xen_intr_pcpu_data * pcpu ; pcpu = DPCPU_ID_PTR ( i , xen_intr_pcpu ) ; memset ( pcpu -> evtchn_enabled , i == 0 ? ~ 0 : 0 , sizeof ( pcpu -> evtchn_enabled ) ) ; } for ( i = 0 ; i < nitems ( s -> evtchn_mask ) ; i ++ ) atomic_store_rel_long ( & s -> evtchn_mask [ i ] , ~ 0 ) ; memset ( xen_intr_port_to_isrc , 0 , sizeof ( xen_intr_port_to_isrc ) ) ; for ( isrc_idx = 0 ; isrc_idx < xen_intr_auto_vector_count ; isrc_idx ++ ) { u_int vector ; vector = FIRST_EVTCHN_INT + isrc_idx ; isrc = ( struct xenisrc * ) intr_lookup_source ( vector ) ; if ( isrc != NULL ) { isrc -> xi_port = 0 ; switch ( isrc -> xi_type ) { case EVTCHN_TYPE_IPI : xen_rebind_ipi ( isrc ) ; break ; case EVTCHN_TYPE_VIRQ : xen_rebind_virq ( isrc ) ; break ; default : break ; } } } }
Return this PIC to service after being suspended.
Return this PIC to service after being suspended .
/* Reset the per-CPU masks */ /* Mask all event channels. */ /* Remove port -> isrc mappings */ /* Free unused isrcs and rebind VIRQs and IPIs */