void intc_intr(int ssr, int spc, int ssp) { struct intc_intrhand *ih; int s, evtcode; evtcode = _reg_read_4(SH4_INTEVT); ih = EVTCODE_IH(evtcode); KDASSERT(ih->ih_func); /* * On entry, all interrrupts are disabled, and exception is enabled. * Enable higher level interrupt here. */ s = _cpu_intr_resume(ih->ih_level); if (evtcode == SH_INTEVT_TMU0_TUNI0) { /* hardclock */ struct clockframe cf; cf.spc = spc; cf.ssr = ssr; cf.ssp = ssp; (*ih->ih_func)(&cf); } else { (*ih->ih_func)(ih->ih_arg); } }
void mtx_leave(struct mutex *mtx) { MUTEX_ASSERT_LOCKED(mtx); mtx->mtx_lock = 0; if (mtx->mtx_wantipl != IPL_NONE << 4) _cpu_intr_resume(mtx->mtx_oldipl); }