FreeBSD/sys/kern/kern_poll.c
/*
 * netisr_poll is typically scheduled once per tick.
 */
netisr_poll is typically scheduled once per tick.
netisr_poll is typically scheduled once per tick .
void
netisr_poll(void)
{
	int i, cycles;
	enum poll_cmd arg = POLL_ONLY;
	if (poll_handlers == 0)
		return;
	mtx_lock(&poll_mtx);
	if (!netisr_poll_scheduled) {
		mtx_unlock(&poll_mtx);
		return;
	}
	netisr_poll_scheduled = 0;
	phase = 3;
	if (residual_burst == 0) { 
		microuptime(&poll_start_t);
		if (++reg_frac_count == reg_frac) {
			arg = POLL_AND_CHECK_STATUS;
			reg_frac_count = 0;
		}
		residual_burst = poll_burst;
	}
	cycles = (residual_burst < poll_each_burst) ?
		residual_burst : poll_each_burst;
	residual_burst -= cycles;
	for (i = 0 ; i < poll_handlers ; i++)
		pr[i].handler(pr[i].ifp, arg, cycles);
	phase = 4;
	mtx_unlock(&poll_mtx);
}
void netisr_poll ( void ) { int i , cycles ; enum poll_cmd arg = POLL_ONLY ; if ( poll_handlers == 0 ) return ; mtx_lock ( & poll_mtx ) ; if ( ! netisr_poll_scheduled ) { mtx_unlock ( & poll_mtx ) ; return ; } netisr_poll_scheduled = 0 ; phase = 3 ; if ( residual_burst == 0 ) { microuptime ( & poll_start_t ) ; if ( ++ reg_frac_count == reg_frac ) { arg = POLL_AND_CHECK_STATUS ; reg_frac_count = 0 ; } residual_burst = poll_burst ; } cycles = ( residual_burst < poll_each_burst ) ? residual_burst : poll_each_burst ; residual_burst -= cycles ; for ( i = 0 ; i < poll_handlers ; i ++ ) pr [ i ] . handler ( pr [ i ] . ifp , arg , cycles ) ; phase = 4 ; mtx_unlock ( & poll_mtx ) ; }
netisr_poll is typically scheduled once per tick.
netisr_poll is typically scheduled once per tick .
/* first call in this tick */