FreeBSD/sys/kern/kern_intr.c
/*
 * Schedule a software interrupt thread.
 */
Schedule a software interrupt thread.
Schedule a software interrupt thread .
void
swi_sched(void *cookie, int flags)
{
	struct intr_handler *ih = (struct intr_handler *)cookie;
	struct intr_event *ie = ih->ih_event;
	struct intr_entropy entropy;
	int error;
	CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name,
	    ih->ih_need);
	entropy.event = (uintptr_t)ih;
	entropy.td = curthread;
	random_harvest_queue(&entropy, sizeof(entropy), 1, RANDOM_SWI);
	ih->ih_need = 1;
	if (!(flags & SWI_DELAY)) {
		PCPU_INC(cnt.v_soft);
#ifdef INTR_FILTER
		error = intr_event_schedule_thread(ie, ie->ie_thread);
#else
		error = intr_event_schedule_thread(ie);
#endif
		KASSERT(error == 0, ("stray software interrupt"));
	}
}
void swi_sched ( void * cookie , int flags ) { struct intr_handler * ih = ( struct intr_handler * ) cookie ; struct intr_event * ie = ih -> ih_event ; struct intr_entropy entropy ; int error ; CTR3 ( KTR_INTR , " " , ie -> ie_name , ih -> ih_name , ih -> ih_need ) ; entropy . event = ( uintptr_t ) ih ; entropy . td = curthread ; random_harvest_queue ( & entropy , sizeof ( entropy ) , 1 , RANDOM_SWI ) ; ih -> ih_need = 1 ; if ( ! ( flags & SWI_DELAY ) ) { PCPU_INC ( cnt . v_soft ) ; #ifdef INTR_FILTER error = intr_event_schedule_thread ( ie , ie -> ie_thread ) ; #else error = intr_event_schedule_thread ( ie ) ; #endif KASSERT ( error == 0 , ( " " ) ) ; } }
Schedule a software interrupt thread.
Schedule a software interrupt thread .
/*
	 * Set ih_need for this handler so that if the ithread is already
	 * running it will execute this handler on the next pass.  Otherwise,
	 * it will execute it the next time it runs.
	 */