FreeBSD/sys/arm/arm/pl310.c
/*
 * Setup interrupt handling.  This is done only if the cache controller is
 * disabled, for debugging.  We set counters so when a cache event happens we'll
 * get interrupted and be warned that something is wrong, because no cache
 * events should happen if we're disabled.
 */
Setup interrupt handling.  This is done only if the cache controller is
disabled, for debugging.  We set counters so when a cache event happens we'll
get interrupted and be warned that something is wrong, because no cache
events should happen if we're disabled.
Setup interrupt handling . This is done only if the cache controller is disabled for debugging . We set counters so when a cache event happens we ' ll get interrupted and be warned that something is wrong because no cache events should happen if we ' re disabled .
static void
pl310_config_intr(void *arg)
{
	struct pl310_softc * sc;
	sc = arg;
	bus_setup_intr(sc->sc_dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
	    pl310_filter, NULL, sc, &sc->sc_irq_h);
	pl310_write4(sc, PL310_EVENT_COUNTER0_CONF,
	    EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_CO);
	pl310_write4(sc, PL310_EVENT_COUNTER1_CONF,
	    EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ);
	pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR);
	pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL);
	pl310_write4(sc, PL310_EVENT_COUNTER_CTRL,
	    EVENT_COUNTER_CTRL_ENABLED |
	    EVENT_COUNTER_CTRL_C0_RESET |
	    EVENT_COUNTER_CTRL_C1_RESET);
	config_intrhook_disestablish(sc->sc_ich);
	free(sc->sc_ich, M_DEVBUF);
	sc->sc_ich = NULL;
}
static void pl310_config_intr ( void * arg ) { struct pl310_softc * sc ; sc = arg ; bus_setup_intr ( sc -> sc_dev , sc -> sc_irq_res , INTR_TYPE_MISC | INTR_MPSAFE , pl310_filter , NULL , sc , & sc -> sc_irq_h ) ; pl310_write4 ( sc , PL310_EVENT_COUNTER0_CONF , EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_CO ) ; pl310_write4 ( sc , PL310_EVENT_COUNTER1_CONF , EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ ) ; pl310_write4 ( sc , PL310_INTR_CLEAR , INTR_MASK_ECNTR ) ; pl310_write4 ( sc , PL310_INTR_MASK , INTR_MASK_ALL ) ; pl310_write4 ( sc , PL310_EVENT_COUNTER_CTRL , EVENT_COUNTER_CTRL_ENABLED | EVENT_COUNTER_CTRL_C0_RESET | EVENT_COUNTER_CTRL_C1_RESET ) ; config_intrhook_disestablish ( sc -> sc_ich ) ; free ( sc -> sc_ich , M_DEVBUF ) ; sc -> sc_ich = NULL ; }
Setup interrupt handling.
Setup interrupt handling .
/* activate the interrupt */ /* Cache Line Eviction for Counter 0 */ /* Data Read Request for Counter 1 */ /* Enable and clear pending interrupts */ /* Enable counters and reset C0 and C1 */