FreeBSD/sys/arm/nvidia/tegra_rtc.c
/*
 * Get the time of day clock and return it in ts.
 * Return 0 on success, an error number otherwise.
 */
Get the time of day clock and return it in ts.
Return 0 on success, an error number otherwise.
Get the time of day clock and return it in ts . Return 0 on success an error number otherwise .
static int
tegra_rtc_gettime(device_t dev, struct timespec *ts)
{
	struct tegra_rtc_softc *sc;
	struct timeval tv;
	uint32_t msec, sec;
	sc = device_get_softc(dev);
	LOCK(sc);
	msec = RD4(sc, RTC_MILLI_SECONDS);
	sec = RD4(sc, RTC_SHADOW_SECONDS);
	UNLOCK(sc);
	tv.tv_sec = sec;
	tv.tv_usec = msec * 1000;
	TIMEVAL_TO_TIMESPEC(&tv, ts);
	return (0);
}
static int tegra_rtc_gettime ( device_t dev , struct timespec * ts ) { struct tegra_rtc_softc * sc ; struct timeval tv ; uint32_t msec , sec ; sc = device_get_softc ( dev ) ; LOCK ( sc ) ; msec = RD4 ( sc , RTC_MILLI_SECONDS ) ; sec = RD4 ( sc , RTC_SHADOW_SECONDS ) ; UNLOCK ( sc ) ; tv . tv_sec = sec ; tv . tv_usec = msec * 1000 ; TIMEVAL_TO_TIMESPEC ( & tv , ts ) ; return ( 0 ) ; }
Get the time of day clock and return it in ts.
Get the time of day clock and return it in ts .