/Zephyr-latest/lib/posix/options/ |
D | clock.c | 93 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/ |
D | benchmark.c | 70 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/ |
D | net_time.h | 112 #define NET_TIME_SEC_MAX (NET_TIME_MAX / NSEC_PER_SEC) 115 #define NET_TIME_SEC_MIN (NET_TIME_MIN / NSEC_PER_SEC)
|
D | ptp_time.h | 220 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/ |
D | thrd.h | 26 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/ |
D | main.c | 128 ((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/ |
D | main.c | 75 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/ |
D | timer.c | 70 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()
|
D | clock.c | 20 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()
|
D | pthread.c | 412 [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()
|
D | mutex.c | 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/drivers/ptp_clock/ |
D | ptp_clock_nxp_enet.c | 72 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/ |
D | timing.c | 55 return (cycles) * (NSEC_PER_SEC) / (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC); in soc_timing_cycles_to_ns()
|
/Zephyr-latest/soc/microchip/mec/mec172x/ |
D | timing.c | 65 return cycles * NSEC_PER_SEC / CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; in soc_timing_cycles_to_ns()
|
/Zephyr-latest/subsys/net/lib/ptp/ |
D | clock.c | 524 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()
|
D | port.c | 25 #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/ |
D | timing.c | 67 return (cycles) * (NSEC_PER_SEC) / (SystemCoreClock); in soc_timing_cycles_to_ns()
|
/Zephyr-latest/arch/x86/ |
D | timing.c | 80 return ((cycles) * NSEC_PER_SEC / tsc_freq); in arch_timing_cycles_to_ns()
|
/Zephyr-latest/drivers/ethernet/ |
D | eth_e1000.c | 337 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/ |
D | gptp_private.h | 117 return (ts->second * NSEC_PER_SEC) + ts->nanosecond; in gptp_timestamp_to_nsec()
|
D | gptp_mi.c | 390 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/ |
D | pwm_xmc4xxx_ccu8.c | 118 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/ |
D | gatt_write_common.c | 39 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/ |
D | mdio_nxp_enet.c | 185 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/ |
D | pwm.h | 550 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()
|