FreeBSD/sys/dev/viawd/viawd.c
/*
 * Watchdog event handler - called by the framework to enable or disable
 * the watchdog or change the initial timeout value.
 */
Watchdog event handler - called by the framework to enable or disable
the watchdog or change the initial timeout value.
Watchdog event handler - called by the framework to enable or disable the watchdog or change the initial timeout value .
static void
viawd_event(void *arg, unsigned int cmd, int *error)
{
	struct viawd_softc *sc = arg;
	unsigned int timeout;
	cmd &= WD_INTERVAL;
	timeout = ((uint64_t)1 << cmd) / 1000000000;
	if (cmd) {
		if (timeout != sc->timeout)
			viawd_tmr_set(sc, timeout);
		viawd_tmr_state(sc, 1);
		*error = 0;
	} else
		viawd_tmr_state(sc, 0);
}
static void viawd_event ( void * arg , unsigned int cmd , int * error ) { struct viawd_softc * sc = arg ; unsigned int timeout ; cmd &= WD_INTERVAL ; timeout = ( ( uint64_t ) 1 << cmd ) / 1000000000 ; if ( cmd ) { if ( timeout != sc -> timeout ) viawd_tmr_set ( sc , timeout ) ; viawd_tmr_state ( sc , 1 ) ; * error = 0 ; } else viawd_tmr_state ( sc , 0 ) ; }
Watchdog event handler - called by the framework to enable or disable
 the watchdog or change the initial timeout value.
Watchdog event handler - called by the framework to enable or disable the watchdog or change the initial timeout value .
/* Convert from power-of-two-ns to second. */