Home
last modified time | relevance | path

Searched refs:tv_nsec (Results 1 – 25 of 31) sorted by relevance

12

/Zephyr-latest/lib/posix/options/
Dclock.c38 base->tv_nsec = 0; in z_impl___posix_clock_get_base()
71 base.tv_nsec = 0; in clock_gettime()
89 ts->tv_nsec = (int32_t) k_ticks_to_ns_floor32(nremainder); in clock_gettime()
92 ts->tv_nsec += base.tv_nsec; in clock_gettime()
93 if (ts->tv_nsec >= NSEC_PER_SEC) { in clock_gettime()
95 ts->tv_nsec -= NSEC_PER_SEC; in clock_gettime()
116 .tv_nsec = NSEC_PER_SEC / CONFIG_SYS_CLOCK_TICKS_PER_SEC, in clock_getres()
141 if (tp->tv_nsec < 0 || tp->tv_nsec >= NSEC_PER_SEC) { in clock_settime()
147 int64_t delta = (int64_t)NSEC_PER_SEC * tp->tv_sec + tp->tv_nsec in clock_settime()
151 base.tv_nsec = delta % NSEC_PER_SEC; in clock_settime()
[all …]
Dtimer.c221 its->it_value.tv_nsec = (int32_t) nsecs; in timer_gettime()
225 its->it_value.tv_nsec = 0; in timer_gettime()
245 value->it_interval.tv_nsec < 0 || in timer_settime()
246 value->it_interval.tv_nsec >= NSEC_PER_SEC || in timer_settime()
247 value->it_value.tv_nsec < 0 || in timer_settime()
248 value->it_value.tv_nsec >= NSEC_PER_SEC) { in timer_settime()
259 if ((value->it_value.tv_sec == 0) && (value->it_value.tv_nsec == 0)) { in timer_settime()
271 timer->interval.tv_nsec = value->it_interval.tv_nsec; in timer_settime()
Dtimespec_to_timeout.c22 nsecs = abstime->tv_nsec - curtime.tv_nsec; in timespec_to_timeoutms()
Drwlock.c205 if (abstime->tv_nsec < 0 || abstime->tv_nsec > NSEC_PER_SEC) { in pthread_rwlock_timedrdlock()
278 if (abstime->tv_nsec < 0 || abstime->tv_nsec > NSEC_PER_SEC) { in pthread_rwlock_timedwrlock()
Ddevice_io.c126 .tv_nsec = (long)((timeout == NULL) ? 0 : timeout->tv_usec * NSEC_PER_USEC)}; in select()
Dsemaphore.c168 if ((abstime->tv_sec < 0) || (abstime->tv_nsec >= NSEC_PER_SEC)) { in sem_timedwait()
/Zephyr-latest/tests/posix/common/src/
Dtimer.c49 value.it_value.tv_nsec = DURATION_NSECS; in test_timer()
51 value.it_interval.tv_nsec = PERIOD_NSECS; in test_timer()
58 (int)value.it_interval.tv_nsec); in test_timer()
60 (int)value.it_value.tv_nsec); in test_timer()
66 if (te.tv_nsec >= ts.tv_nsec) { in test_timer()
68 nsecs_elapsed = te.tv_nsec - ts.tv_nsec; in test_timer()
70 nsecs_elapsed = NSEC_PER_SEC + te.tv_nsec - ts.tv_nsec; in test_timer()
75 uint64_t first_sig = value.it_value.tv_sec * NSEC_PER_SEC + value.it_value.tv_nsec; in test_timer()
76 uint64_t sig_interval = value.it_interval.tv_sec * NSEC_PER_SEC + value.it_interval.tv_nsec; in test_timer()
116 value.it_interval.tv_nsec = 500000000; in ZTEST()
[all …]
Dnanosleep.c52 zassert_equal(rem.tv_nsec, 0, "actual: %d expected: %d", rem.tv_nsec, 0); in common_errors()
56 req = (struct timespec){.tv_sec = -1, .tv_nsec = 0}; in common_errors()
61 req = (struct timespec){.tv_sec = 0, .tv_nsec = -1}; in common_errors()
66 req = (struct timespec){.tv_sec = -1, .tv_nsec = -1}; in common_errors()
72 req = (struct timespec){.tv_sec = 0, .tv_nsec = 1000000000}; in common_errors()
82 req = (struct timespec){.tv_sec = 1, .tv_nsec = 1}; in common_errors()
86 zassert_equal(req.tv_nsec, 1); in common_errors()
92 zassert_equal(rem.tv_nsec, 0, "actual: %d expected: %d", rem.tv_nsec, 0); in common_errors()
100 req = (struct timespec){.tv_sec = 0, .tv_nsec = 1}; in common_errors()
104 zassert_equal(req.tv_nsec, 0, "actual: %d expected: %d", req.tv_nsec, 0); in common_errors()
[all …]
Dpthread.c411 [1] = {.tv_nsec = -1}, in ZTEST()
412 [2] = {.tv_nsec = NSEC_PER_SEC}, in ZTEST()
418 not_done.tv_nsec += sleep_duration_ms / 2 * NSEC_PER_MSEC; in ZTEST()
419 done.tv_nsec += sleep_duration_ms * 1.5 * NSEC_PER_MSEC; in ZTEST()
420 while (not_done.tv_nsec >= NSEC_PER_SEC) { in ZTEST()
422 not_done.tv_nsec -= NSEC_PER_SEC; in ZTEST()
424 while (done.tv_nsec >= NSEC_PER_SEC) { in ZTEST()
426 done.tv_nsec -= NSEC_PER_SEC; in ZTEST()
506 .tv_nsec = 0, in ZTEST()
Dclock.c33 return ts->tv_sec * NSEC_PER_SEC + ts->tv_nsec; in ts_to_ns()
39 ts->tv_nsec = tv->tv_usec * NSEC_PER_USEC; in tv_to_ts()
88 zassert_not_equal(ts.tv_nsec, -1); in ZTEST()
236 .tv_nsec = 1, in ZTEST()
Dmutex.c174 ts->tv_nsec += ms * NSEC_PER_MSEC; in timespec_add_ms()
175 oflow = ts->tv_nsec >= NSEC_PER_SEC; in timespec_add_ms()
177 ts->tv_nsec -= oflow * NSEC_PER_SEC; in timespec_add_ms()
/Zephyr-latest/samples/drivers/counter/maxim_ds3231/src/
Dmain.c71 if (a->tv_nsec >= b->tv_nsec) { in timespec_subtract()
72 amb->tv_nsec = a->tv_nsec - b->tv_nsec; in timespec_subtract()
75 amb->tv_nsec = NSEC_PER_SEC + a->tv_nsec - b->tv_nsec; in timespec_subtract()
89 apb->tv_nsec = a->tv_nsec + b->tv_nsec; in timespec_add()
91 if (apb->tv_nsec >= NSEC_PER_SEC) { in timespec_add()
93 apb->tv_nsec -= NSEC_PER_SEC; in timespec_add()
127 adj.tv_nsec = (offset_syncclock % syncclock_Hz) in min_alarm_handler()
137 ts->tv_nsec += adj.tv_nsec; in min_alarm_handler()
138 if (ts->tv_nsec >= NSEC_PER_SEC) { in min_alarm_handler()
140 ts->tv_nsec -= NSEC_PER_SEC; in min_alarm_handler()
[all …]
/Zephyr-latest/tests/lib/c_lib/thrd/src/
Dthrd.h25 ts->tv_nsec += ms * NSEC_PER_MSEC; in timespec_add_ms()
26 oflow = ts->tv_nsec >= NSEC_PER_SEC; in timespec_add_ms()
28 ts->tv_nsec -= oflow * NSEC_PER_SEC; in timespec_add_ms()
Dthrd.c31 duration = (struct timespec){.tv_nsec = delay_ms[i] * NSEC_PER_MSEC}; in ZTEST()
32 remaining = (struct timespec){.tv_sec = 4242, .tv_nsec = 4242}; in ZTEST()
39 zassert_equal(remaining.tv_nsec, 0); in ZTEST()
/Zephyr-latest/lib/libc/armstdc/include/sys/
D_timespec.h14 long tv_nsec; member
/Zephyr-latest/include/zephyr/posix/
Dtime.h34 long tv_nsec; member
90 return (int32_t)(to->tv_sec * MSEC_PER_SEC) + (int32_t)(to->tv_nsec / NSEC_PER_MSEC); in _ts_to_ms()
/Zephyr-latest/boards/native/native_posix/
Dtimer_model.c146 return (uint64_t)tv.tv_sec * 1e6 + tv.tv_nsec / 1000; in get_host_us_time()
165 realhosttime = (uint64_t)tv.tv_sec * 1e6 + tv.tv_nsec / 1000; in hwtimer_init()
213 requested_time.tv_nsec = (diff - in hwtimer_tick_timer_reached()
400 uint64_t rt_us = (uint64_t)tv.tv_sec * 1000000ULL + tv.tv_nsec / 1000; in hwtimer_get_pseudohost_rtc_time()
401 uint32_t rt_ns = tv.tv_nsec % 1000; in hwtimer_get_pseudohost_rtc_time()
/Zephyr-latest/lib/libc/minimal/include/sys/
D_timespec.h24 long tv_nsec; member
/Zephyr-latest/scripts/native_simulator/native/src/
Dtimer_model.c139 return (uint64_t)tv.tv_sec * 1e6 + tv.tv_nsec / 1000; in get_host_us_time()
158 realhosttime = (uint64_t)tv.tv_sec * 1e6 + tv.tv_nsec / 1000; in hwtimer_init()
203 requested_time.tv_nsec = (diff - in hwtimer_tick_timer_reached()
392 uint64_t rt_us = (uint64_t)tv.tv_sec * 1000000ULL + tv.tv_nsec / 1000; in hwtimer_get_pseudohost_rtc_time()
393 uint32_t rt_ns = tv.tv_nsec % 1000; in hwtimer_get_pseudohost_rtc_time()
/Zephyr-latest/include/zephyr/net/
Dsocket_select.h54 .tv_nsec = (long)((timeout == NULL) ? 0 : timeout->tv_usec * NSEC_PER_USEC)}; in zsock_select()
/Zephyr-latest/tests/posix/rwlocks/src/
Dmain.c58 time.tv_nsec = 0; in ZTEST()
89 time.tv_nsec = 0; in ZTEST()
/Zephyr-latest/subsys/net/lib/config/
Dinit_clock_sntp.c52 tspec.tv_nsec = ((uint64_t)ts.fraction * (1000 * 1000 * 1000)) >> 32; in net_init_clock_via_sntp()
/Zephyr-latest/drivers/ethernet/
Deth_native_posix_adapt.c130 *nanosecond = (uint32_t)tp.tv_nsec; in eth_clock_gettime()
/Zephyr-latest/subsys/shell/modules/
Ddate_service.c178 tp.tv_nsec = 0; in cmd_date_set()
/Zephyr-latest/samples/posix/philosophers/src/
Dmain.c128 uptime = ts.tv_sec * MSEC_PER_SEC + (ts.tv_nsec / NSEC_PER_MSEC); in get_random_delay()

12