* 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. */
| 134 | * locking or sleeping they need to. |
| 135 | */ |
| 136 | static void |
| 137 | settime_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 | |
| 159 | static void |
| 160 | clock_dbgprint_hdr(device_t dev, int rw) |
nothing calls this directly
no test coverage detected