Home
last modified time | relevance | path

Searched refs:NSEC_PER_SEC (Results 1 – 25 of 52) sorted by relevance

123

/Zephyr-latest/lib/posix/options/
Dclock.c93 if (ts->tv_nsec >= NSEC_PER_SEC) { in clock_gettime()
95 ts->tv_nsec -= NSEC_PER_SEC; in clock_gettime()
104 CONFIG_SYS_CLOCK_TICKS_PER_SEC <= NSEC_PER_SEC, in clock_getres()
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()
150 base.tv_sec = delta / NSEC_PER_SEC; in clock_settime()
151 base.tv_nsec = delta % NSEC_PER_SEC; in clock_settime()
214 if ((rqtp->tv_sec < 0) || (rqtp->tv_nsec < 0) || (rqtp->tv_nsec >= NSEC_PER_SEC)) { in __z_clock_nanosleep()
219 if ((flags & TIMER_ABSTIME) == 0 && unlikely(rqtp->tv_sec >= ULLONG_MAX / NSEC_PER_SEC)) { in __z_clock_nanosleep()
[all …]
/Zephyr-latest/samples/subsys/zbus/benchmark/src/
Dbenchmark.c70 uint64_t i = ((BYTES_TO_BE_SENT * NSEC_PER_SEC) / MB(1)) / duration_ns; in producer_thread()
71 uint64_t f = ((BYTES_TO_BE_SENT * NSEC_PER_SEC * 100) / MB(1) / duration_ns) % 100; in producer_thread()
75 LOG_INF("Duration: %llu.%09llus", duration_ns / NSEC_PER_SEC, duration_ns % NSEC_PER_SEC); in producer_thread()
/Zephyr-latest/include/zephyr/net/
Dnet_time.h112 #define NET_TIME_SEC_MAX (NET_TIME_MAX / NSEC_PER_SEC)
115 #define NET_TIME_SEC_MIN (NET_TIME_MIN / NSEC_PER_SEC)
Dptp_time.h220 return ((int64_t)ts->second * NSEC_PER_SEC) + ts->nanosecond; in net_ptp_time_to_ns()
237 ts.second = nsec / NSEC_PER_SEC; in ns_to_net_ptp_time()
238 ts.nanosecond = nsec % NSEC_PER_SEC; in ns_to_net_ptp_time()
/Zephyr-latest/tests/lib/c_lib/thrd/src/
Dthrd.h26 oflow = ts->tv_nsec >= NSEC_PER_SEC; in timespec_add_ms()
28 ts->tv_nsec -= oflow * NSEC_PER_SEC; in timespec_add_ms()
/Zephyr-latest/tests/drivers/disk/disk_performance/src/
Dmain.c128 ((SECTOR_SIZE * (NSEC_PER_SEC / time_ns))) / 1024); in ZTEST()
135 ((BUF_SIZE) * (NSEC_PER_SEC / time_ns)) / 1024); in ZTEST()
191 ((SECTOR_SIZE * (NSEC_PER_SEC / time_ns))) / 1024); in ZTEST()
198 ((BUF_SIZE) * (NSEC_PER_SEC / time_ns)) / 1024); in ZTEST()
241 ((uint64_t)NSEC_PER_SEC))) in ZTEST()
293 ((uint64_t)NSEC_PER_SEC))) in ZTEST()
/Zephyr-latest/samples/drivers/counter/maxim_ds3231/src/
Dmain.c75 amb->tv_nsec = NSEC_PER_SEC + a->tv_nsec - b->tv_nsec; in timespec_subtract()
91 if (apb->tv_nsec >= NSEC_PER_SEC) { in timespec_add()
93 apb->tv_nsec -= NSEC_PER_SEC; in timespec_add()
128 * (uint64_t)NSEC_PER_SEC / syncclock_Hz; 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()
194 .tv_nsec = (uint64_t)NSEC_PER_SEC * syncclock / syncclock_Hz, in set_aligned_clock()
/Zephyr-latest/tests/posix/common/src/
Dtimer.c70 nsecs_elapsed = NSEC_PER_SEC + te.tv_nsec - ts.tv_nsec; in test_timer()
74 uint64_t elapsed = secs_elapsed*NSEC_PER_SEC + nsecs_elapsed; 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()
Dclock.c20 static const struct timespec ref_ts = {1514821501, NSEC_PER_SEC / 2U};
33 return ts->tv_sec * NSEC_PER_SEC + ts->tv_nsec; in ts_to_ns()
138 ts = (struct timespec){0, NSEC_PER_SEC}; in ZTEST()
162 zassert_true(diff_ns >= 0 && diff_ns <= NSEC_PER_SEC); in ZTEST()
Dpthread.c412 [2] = {.tv_nsec = NSEC_PER_SEC}, 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()
Dmutex.c175 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/drivers/ptp_clock/
Dptp_clock_nxp_enet.c72 if ((increment <= (int32_t)(-NSEC_PER_SEC)) || in ptp_clock_nxp_enet_adjust()
73 (increment >= (int32_t)NSEC_PER_SEC)) { in ptp_clock_nxp_enet_adjust()
77 if (data->base->ATPER != NSEC_PER_SEC) { in ptp_clock_nxp_enet_adjust()
83 data->base->ATPER = NSEC_PER_SEC - increment; in ptp_clock_nxp_enet_adjust()
105 int hw_inc = NSEC_PER_SEC / enet_ref_pll_rate; in ptp_clock_nxp_enet_rate_adjust()
/Zephyr-latest/soc/microchip/mec/mec15xx/
Dtiming.c55 return (cycles) * (NSEC_PER_SEC) / (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC); in soc_timing_cycles_to_ns()
/Zephyr-latest/soc/microchip/mec/mec172x/
Dtiming.c65 return cycles * NSEC_PER_SEC / CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; in soc_timing_cycles_to_ns()
/Zephyr-latest/subsys/net/lib/ptp/
Dclock.c524 if ((offset > (int64_t)NSEC_PER_SEC) || (offset < -(int64_t)NSEC_PER_SEC)) { in ptp_clock_synchronize()
532 current.second = (uint64_t)(current.second - (offset / NSEC_PER_SEC)); in ptp_clock_synchronize()
533 dest_nsec = (int32_t)(current.nanosecond - (offset % NSEC_PER_SEC)); in ptp_clock_synchronize()
537 dest_nsec += NSEC_PER_SEC; in ptp_clock_synchronize()
538 } else if (dest_nsec >= NSEC_PER_SEC) { in ptp_clock_synchronize()
540 dest_nsec -= NSEC_PER_SEC; in ptp_clock_synchronize()
Dport.c25 #define PORT_DELAY_REQ_CLEARE_TO (3 * NSEC_PER_SEC)
92 ((uint64_t)NSEC_PER_SEC * factor) >> -log_seconds : in port_timer_set_timeout()
93 ((uint64_t)NSEC_PER_SEC * factor) << log_seconds; in port_timer_set_timeout()
106 timeout = ((uint64_t)NSEC_PER_SEC * min_factor) >> -log_seconds; in port_timer_set_timeout_random()
107 random_ns = (uint64_t)NSEC_PER_SEC >> -log_seconds; in port_timer_set_timeout_random()
109 timeout = ((uint64_t)NSEC_PER_SEC * min_factor) << log_seconds; in port_timer_set_timeout_random()
110 random_ns = ((uint64_t)span * NSEC_PER_SEC) << log_seconds; in port_timer_set_timeout_random()
125 t1 = origin_ts.second * NSEC_PER_SEC + origin_ts.nanosecond; in port_synchronize()
126 t2 = ingress_ts.second * NSEC_PER_SEC + ingress_ts.nanosecond; in port_synchronize()
406 (1 << msg->header.log_msg_interval) * NSEC_PER_SEC; in foreign_clock_cleanup()
[all …]
/Zephyr-latest/soc/nordic/
Dtiming.c67 return (cycles) * (NSEC_PER_SEC) / (SystemCoreClock); in soc_timing_cycles_to_ns()
/Zephyr-latest/arch/x86/
Dtiming.c80 return ((cycles) * NSEC_PER_SEC / tsc_freq); in arch_timing_cycles_to_ns()
/Zephyr-latest/drivers/ethernet/
Deth_e1000.c337 ptp_context->clock_time = tm->second * NSEC_PER_SEC + tm->nanosecond; in ptp_clock_e1000_set()
348 tm->second = ptp_context->clock_time / NSEC_PER_SEC; in ptp_clock_e1000_get()
349 tm->nanosecond = ptp_context->clock_time - tm->second * NSEC_PER_SEC; in ptp_clock_e1000_get()
366 const int hw_inc = NSEC_PER_SEC / CONFIG_ETH_E1000_PTP_CLOCK_SRC_HZ; in ptp_clock_e1000_rate_adjust()
/Zephyr-latest/subsys/net/l2/ethernet/gptp/
Dgptp_private.h117 return (ts->second * NSEC_PER_SEC) + ts->nanosecond; in gptp_timestamp_to_nsec()
Dgptp_mi.c390 port_ds->sync_receipt_timeout_time_itv *= NSEC_PER_SEC; in gptp_mi_pss_rcv_compute()
720 global_ds->sync_receipt_time.second = sync_receipt_time / NSEC_PER_SEC; in gptp_mi_clk_slave_sync_compute()
722 (sync_receipt_time % NSEC_PER_SEC) * GPTP_POW2_16; in gptp_mi_clk_slave_sync_compute()
769 (global_ds->sync_receipt_local_time / NSEC_PER_SEC); in gptp_update_local_port_clock()
772 (global_ds->sync_receipt_local_time % NSEC_PER_SEC); in gptp_update_local_port_clock()
781 nanosecond_diff = NSEC_PER_SEC + nanosecond_diff; in gptp_update_local_port_clock()
786 nanosecond_diff = -(int64_t)NSEC_PER_SEC + nanosecond_diff; in gptp_update_local_port_clock()
820 tm.nanosecond += NSEC_PER_SEC; in gptp_update_local_port_clock()
821 } else if (tm.nanosecond >= NSEC_PER_SEC) { in gptp_update_local_port_clock()
823 tm.nanosecond -= NSEC_PER_SEC; in gptp_update_local_port_clock()
[all …]
/Zephyr-latest/drivers/pwm/
Dpwm_xmc4xxx_ccu8.c118 high_deadtime_value = config->deadtime_high_ns[channel] * cycles / NSEC_PER_SEC; in pwm_xmc4xxx_ccu8_set_cycles()
119 low_deadtime_value = config->deadtime_low_ns[channel] * cycles / NSEC_PER_SEC; in pwm_xmc4xxx_ccu8_set_cycles()
/Zephyr-latest/samples/bluetooth/central_gatt_write/src/
Dgatt_write_common.c39 if (delta > (1U * NSEC_PER_SEC)) { in write_cmd_cb()
58 write_rate = ((uint64_t)write_len << 3) * (1U * NSEC_PER_SEC) / in write_cmd_cb()
/Zephyr-latest/drivers/mdio/
Dmdio_nxp_enet.c185 uint32_t holdtime = (10 + NSEC_PER_SEC / enet_module_clock_rate - 1) / in nxp_enet_mdio_post_module_reset_init()
186 (NSEC_PER_SEC / enet_module_clock_rate) - 1; in nxp_enet_mdio_post_module_reset_init()
/Zephyr-latest/include/zephyr/drivers/
Dpwm.h550 period_cycles = (period * cycles_per_sec) / NSEC_PER_SEC; in pwm_set()
555 pulse_cycles = (pulse * cycles_per_sec) / NSEC_PER_SEC; in pwm_set()
668 if (u64_mul_overflow(cycles, (uint64_t)NSEC_PER_SEC, &temp)) { in pwm_cycles_to_nsec()

123