Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/efidev/efirtc.c
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | efirtc_settime(device_t dev, struct timespec *ts) | ||||
/* | /* | ||||
* We request a timespec with no resolution-adjustment so that we can | * We request a timespec with no resolution-adjustment so that we can | ||||
* apply it ourselves based on whether or not the clock zeroes the | * apply it ourselves based on whether or not the clock zeroes the | ||||
* sub-second part of the time when setting the time. | * sub-second part of the time when setting the time. | ||||
*/ | */ | ||||
ts->tv_sec -= utc_offset(); | ts->tv_sec -= utc_offset(); | ||||
if (!efirtc_zeroes_subseconds) | if (!efirtc_zeroes_subseconds) | ||||
timespecadd(ts, &efirtc_resadj); | timespecadd(ts, &efirtc_resadj, ts); | ||||
clock_ts_to_ct(ts, &ct); | clock_ts_to_ct(ts, &ct); | ||||
clock_dbgprint_ct(dev, CLOCK_DBG_WRITE, &ct); | clock_dbgprint_ct(dev, CLOCK_DBG_WRITE, &ct); | ||||
bzero(&tm, sizeof(tm)); | bzero(&tm, sizeof(tm)); | ||||
tm.tm_sec = ct.sec; | tm.tm_sec = ct.sec; | ||||
tm.tm_min = ct.min; | tm.tm_min = ct.min; | ||||
tm.tm_hour = ct.hour; | tm.tm_hour = ct.hour; | ||||
Show All 32 Lines |