Пример #1
0
void
xb_suspend_comms(device_t dev)
{
	int evtchn;

	evtchn = xen_start_info.store_evtchn;

	hypervisor_mask_event(evtchn);
	event_remove_handler(evtchn, wake_waiting, NULL);
	aprint_verbose_dev(dev, "removed event channel %d\n", evtchn);
}
Пример #2
0
static int
xennet_xenbus_detach(device_t self, int flags)
{
	struct xennet_xenbus_softc *sc = device_private(self);
	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
	int s0, s1;
	RING_IDX i;

	DPRINTF(("%s: xennet_xenbus_detach\n", device_xname(self)));
	s0 = splnet();
	xennet_stop(ifp, 1);
	/* wait for pending TX to complete, and collect pending RX packets */
	xennet_handler(sc);
	while (sc->sc_tx_ring.sring->rsp_prod != sc->sc_tx_ring.rsp_cons) {
		tsleep(xennet_xenbus_detach, PRIBIO, "xnet_detach", hz/2);
		xennet_handler(sc);
	}
	xennet_free_rx_buffer(sc);

	s1 = splvm();
	for (i = 0; i < NET_RX_RING_SIZE; i++) {
		struct xennet_rxreq *rxreq = &sc->sc_rxreqs[i];
		uvm_km_free(kernel_map, rxreq->rxreq_va, PAGE_SIZE,
		    UVM_KMF_WIRED);
	}
	splx(s1);
		
	ether_ifdetach(ifp);
	if_detach(ifp);
	while (xengnt_status(sc->sc_tx_ring_gntref)) {
		tsleep(xennet_xenbus_detach, PRIBIO, "xnet_txref", hz/2);
	}
	xengnt_revoke_access(sc->sc_tx_ring_gntref);
	uvm_km_free(kernel_map, (vaddr_t)sc->sc_tx_ring.sring, PAGE_SIZE,
	    UVM_KMF_WIRED);
	while (xengnt_status(sc->sc_rx_ring_gntref)) {
		tsleep(xennet_xenbus_detach, PRIBIO, "xnet_rxref", hz/2);
	}
	xengnt_revoke_access(sc->sc_rx_ring_gntref);
	uvm_km_free(kernel_map, (vaddr_t)sc->sc_rx_ring.sring, PAGE_SIZE,
	    UVM_KMF_WIRED);
	softint_disestablish(sc->sc_softintr);
	event_remove_handler(sc->sc_evtchn, &xennet_handler, sc);
	splx(s0);
	DPRINTF(("%s: xennet_xenbus_detach done\n", device_xname(self)));
	return 0;
}
Пример #3
0
/* Set up interrupt handler off store event channel. */
int
xb_init_comms(struct device *dev)
{
	int err;

	if (xenbus_irq)
		event_remove_handler(xenbus_irq, wake_waiting, NULL);

	err = event_set_handler(xen_start_info.store_evtchn, wake_waiting,
	    NULL, IPL_TTY, "xenbus");
	if (err) {
		printf("XENBUS request irq failed %i\n", err);
		return err;
	}
	xenbus_irq = xen_start_info.store_evtchn;
	printf("%s: using event channel %d\n", dev->dv_xname, xenbus_irq);
	hypervisor_enable_event(xenbus_irq);
	return 0;
}
Пример #4
0
static bool
xencons_suspend(device_t dev, const pmf_qual_t *qual) {

    int evtch;

    /* dom0 console should not be suspended */
    if (!xendomain_is_dom0()) {
        evtch = xen_start_info.console_evtchn;
        hypervisor_mask_event(evtch);
        if (event_remove_handler(evtch, xencons_handler,
                                 xencons_console_device) != 0) {
            aprint_error_dev(dev,
                             "can't remove handler: xencons_handler\n");
        }

        aprint_verbose_dev(dev, "removed event channel %d\n", evtch);
    }

    return true;
}
Пример #5
0
static void point_based_stop(void)
{
	event_remove_handler(EVENT_BIRTHPOINTS, point_based_points, NULL);	
	event_remove_handler(EVENT_STATS, point_based_stats, NULL);	
	event_remove_handler(EVENT_GOLD, point_based_misc, NULL);	
}
Пример #6
0
void deactivate(void) {
	SDL_DestroyTexture(title_1.texture);
	SDL_DestroyTexture(title_2.texture);
	for (int i = 0; i < 3; ++i) SDL_DestroyTexture(rotator[i].texture);
	event_remove_handler(&any_key_handler);
}