FreeBSD/sys/kern/kern_clocksource.c
/*
 * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
 */
Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
Reconfigure specified per - CPU timer on other CPU . Called from IPI handler .
static int
doconfigtimer(void)
{
	sbintime_t now;
	struct pcpu_state *state;
	state = DPCPU_PTR(timerstate);
	switch (atomic_load_acq_int(&state->action)) {
	case 1:
		now = sbinuptime();
		ET_HW_LOCK(state);
		loadtimer(now, 1);
		ET_HW_UNLOCK(state);
		state->handle = 0;
		atomic_store_rel_int(&state->action, 0);
		return (1);
	case 2:
		ET_HW_LOCK(state);
		et_stop(timer);
		ET_HW_UNLOCK(state);
		state->handle = 0;
		atomic_store_rel_int(&state->action, 0);
		return (1);
	}
	if (atomic_readandclear_int(&state->handle) && !busy) {
		now = sbinuptime();
		handleevents(now, 0);
		return (1);
	}
	return (0);
}
static int doconfigtimer ( void ) { sbintime_t now ; struct pcpu_state * state ; state = DPCPU_PTR ( timerstate ) ; switch ( atomic_load_acq_int ( & state -> action ) ) { case 1 : now = sbinuptime ( ) ; ET_HW_LOCK ( state ) ; loadtimer ( now , 1 ) ; ET_HW_UNLOCK ( state ) ; state -> handle = 0 ; atomic_store_rel_int ( & state -> action , 0 ) ; return ( 1 ) ; case 2 : ET_HW_LOCK ( state ) ; et_stop ( timer ) ; ET_HW_UNLOCK ( state ) ; state -> handle = 0 ; atomic_store_rel_int ( & state -> action , 0 ) ; return ( 1 ) ; } if ( atomic_readandclear_int ( & state -> handle ) && ! busy ) { now = sbinuptime ( ) ; handleevents ( now , 0 ) ; return ( 1 ) ; } return ( 0 ) ; }
Reconfigure specified per-CPU timer on other CPU.
Reconfigure specified per - CPU timer on other CPU .