MCPcopy Create free account
hub / github.com/F-Stack/f-stack / settime_task_func

Function settime_task_func

freebsd/kern/subr_rtc.c:136–157  ·  view source on GitHub ↗

* On the task thread, invoke the clock_settime() method of the clock. Do so * holding no locks, so that clock drivers are free to do whatever kind of * locking or sleeping they need to. */

Source from the content-addressed store, hash-verified

134 * locking or sleeping they need to.
135 */
136static void
137settime_task_func(void *arg, int pending)
138{
139 struct timespec ts;
140 struct rtc_instance *rtc;
141 int error;
142
143 rtc = arg;
144 if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) {
145 getnanotime(&ts);
146 if (!(rtc->flags & CLOCKF_SETTIME_NO_ADJ)) {
147 ts.tv_sec -= utc_offset();
148 timespecadd(&ts, &rtc->resadj, &ts);
149 }
150 } else {
151 ts.tv_sec = 0;
152 ts.tv_nsec = 0;
153 }
154 error = CLOCK_SETTIME(rtc->clockdev, &ts);
155 if (error != 0 && bootverbose)
156 device_printf(rtc->clockdev, "CLOCK_SETTIME error %d\n", error);
157}
158
159static void
160clock_dbgprint_hdr(device_t dev, int rw)

Callers

nothing calls this directly

Calls 3

getnanotimeFunction · 0.85
utc_offsetFunction · 0.85
device_printfFunction · 0.85

Tested by

no test coverage detected