Lines Matching refs:a
53 const struct timespec *a, const struct timespec *b) in timespec_add() argument
55 r->tv_sec = a->tv_sec + b->tv_sec; in timespec_add()
56 r->tv_nsec = a->tv_nsec + b->tv_nsec; in timespec_add()
72 const struct timespec *a, const struct timespec *b) in timespec_sub() argument
74 r->tv_sec = a->tv_sec - b->tv_sec; in timespec_sub()
75 r->tv_nsec = a->tv_nsec - b->tv_nsec; in timespec_sub()
95 timespec_add_nsec(struct timespec *r, const struct timespec *a, uint64_t b) in timespec_add_nsec() argument
100 ((uint64_t)a->tv_sec > (uint64_t)TIME_T_MAX - b_sec); in timespec_add_nsec()
102 r->tv_sec = (uint64_t)a->tv_sec + b_sec; in timespec_add_nsec()
103 r->tv_nsec = (uint64_t)a->tv_nsec + b_nsec; in timespec_add_nsec()
128 timespec_add_msec(struct timespec *r, const struct timespec *a, uint64_t b) in timespec_add_msec() argument
130 return timespec_add_nsec(r, a, b * 1000000) || b > (UINT64_MAX / 1000000); in timespec_add_msec()
140 timespec_to_nsec(const struct timespec *a) in timespec_to_nsec() argument
142 return (uint64_t)a->tv_sec * NSEC_PER_SEC + a->tv_nsec; in timespec_to_nsec()
153 timespec_sub_to_nsec(const struct timespec *a, const struct timespec *b) in timespec_sub_to_nsec() argument
156 timespec_sub(&r, a, b); in timespec_sub_to_nsec()
169 timespec_to_msec(const struct timespec *a) in timespec_to_msec() argument
171 return (uint64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000; in timespec_to_msec()
182 timespec_sub_to_msec(const struct timespec *a, const struct timespec *b) in timespec_sub_to_msec() argument
184 return timespec_sub_to_nsec(a, b) / 1000000; in timespec_sub_to_msec()
196 timespec_to_usec(const struct timespec *a) in timespec_to_usec() argument
198 return (uint64_t)a->tv_sec * 1000000 + a->tv_nsec / 1000; in timespec_to_usec()
213 timespec_to_proto(const struct timespec *a, uint32_t *tv_sec_hi, in timespec_to_proto() argument
216 assert(a->tv_sec >= 0); in timespec_to_proto()
217 assert(a->tv_nsec >= 0 && a->tv_nsec < NSEC_PER_SEC); in timespec_to_proto()
219 uint64_t sec64 = a->tv_sec; in timespec_to_proto()
223 *tv_nsec = a->tv_nsec; in timespec_to_proto()
233 timespec_from_nsec(struct timespec *a, uint64_t b) in timespec_from_nsec() argument
235 a->tv_sec = b / NSEC_PER_SEC; in timespec_from_nsec()
236 a->tv_nsec = b % NSEC_PER_SEC; in timespec_from_nsec()
246 timespec_from_usec(struct timespec *a, uint64_t b) in timespec_from_usec() argument
248 timespec_from_nsec(a, b * 1000); in timespec_from_usec()
258 timespec_from_msec(struct timespec *a, uint64_t b) in timespec_from_msec() argument
260 timespec_from_nsec(a, b * 1000000); in timespec_from_msec()
272 timespec_from_proto(struct timespec *a, uint32_t tv_sec_hi, in timespec_from_proto() argument
275 a->tv_sec = ((uint64_t)tv_sec_hi << 32) + tv_sec_lo; in timespec_from_proto()
276 a->tv_nsec = tv_nsec; in timespec_from_proto()
286 timespec_is_zero(const struct timespec *a) in timespec_is_zero() argument
288 return a->tv_sec == 0 && a->tv_nsec == 0; in timespec_is_zero()
299 timespec_eq(const struct timespec *a, const struct timespec *b) in timespec_eq() argument
301 return a->tv_sec == b->tv_sec && in timespec_eq()
302 a->tv_nsec == b->tv_nsec; in timespec_eq()
326 timespec_after(const struct timespec *a, const struct timespec *b) in timespec_after() argument
328 return (a->tv_sec == b->tv_sec) ? in timespec_after()
329 (a->tv_nsec > b->tv_nsec) : in timespec_after()
330 (a->tv_sec > b->tv_sec); in timespec_after()