Home
last modified time | relevance | path

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

12345678910>>...14

/linux/include/linux/
H A Dacct.h69 #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 in jiffies_to_AHZ()
77 do_div(tmp, (NSEC_PER_SEC / AHZ)); in jiffies_to_AHZ()
84 #if (NSEC_PER_SEC % AHZ) == 0 in nsec_to_AHZ()
85 do_div(x, (NSEC_PER_SEC / AHZ)); in nsec_to_AHZ()
88 do_div(x, (NSEC_PER_SEC / 512)); in nsec_to_AHZ()
96 do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (AHZ/2)) in nsec_to_AHZ()
H A Dtime64.h32 #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
33 #define KTIME_SEC_MIN (KTIME_MIN / NSEC_PER_SEC)
103 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) in timespec64_valid_strict()
144 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
165 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
/linux/tools/testing/radix-tree/
H A Dbenchmark.c12 #define NSEC_PER_SEC 1000000000L macro
38 nsec = (finish.tv_sec - start.tv_sec) * NSEC_PER_SEC + in benchmark_iter()
42 if (loops == 1 && nsec * 5 < NSEC_PER_SEC) { in benchmark_iter()
43 loops = NSEC_PER_SEC / nsec / 4 + 1; in benchmark_iter()
66 nsec = (finish.tv_sec - start.tv_sec) * NSEC_PER_SEC + in benchmark_insert()
87 nsec = (finish.tv_sec - start.tv_sec) * NSEC_PER_SEC + in benchmark_tagging()
108 nsec = (finish.tv_sec - start.tv_sec) * NSEC_PER_SEC + in benchmark_delete()
/linux/tools/testing/selftests/mm/
H A Dksm_tests.c600 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_merge_hugepages_time()
604 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_merge_hugepages_time()
605 scan_time_ns % NSEC_PER_SEC); in ksm_merge_hugepages_time()
607 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_merge_hugepages_time()
641 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_merge_time()
645 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_merge_time()
646 scan_time_ns % NSEC_PER_SEC); in ksm_merge_time()
648 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_merge_time()
688 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_unmerge_time()
692 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_unmerge_time()
[all...]
/linux/drivers/net/ethernet/marvell/octeontx2/af/
H A Dptp.c132 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - ptp_clock_hi)); in ptp_reset_thresh()
135 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - delta_ns)); in ptp_reset_thresh()
148 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - start_ns)); in ptp_hrtimer_start()
169 return sec * NSEC_PER_SEC + nsec; in read_ptp_tstmp_sec_nsec()
195 cycle_time = NSEC_PER_SEC * CYCLE_MULT / ptp_clock_freq; in ptp_calc_adjusted_comp()
202 while (ptp_clock_nsec < NSEC_PER_SEC) { in ptp_calc_adjusted_comp()
209 ns_drift = ptp_clock_nsec - NSEC_PER_SEC; in ptp_calc_adjusted_comp()
260 writeq(timestamp / NSEC_PER_SEC, in ptp_atomic_update()
263 nxt_rollover_set = roundup(timestamp, NSEC_PER_SEC); in ptp_atomic_update()
264 curr_rollover_set = nxt_rollover_set - NSEC_PER_SEC; in ptp_atomic_update()
[all …]
/linux/drivers/pwm/
H A Dpwm-adp5585.c32 #define ADP5585_PWM_MIN_PERIOD_NS (2ULL * NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ)
33 #define ADP5585_PWM_MAX_PERIOD_NS (2ULL * 0xffff * NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ)
83 on = div_u64(duty_cycle, NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_apply()
84 off = div_u64(period, NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ) - on; in pwm_adp5585_apply()
130 state->duty_cycle = on * (NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_get_state()
131 state->period = (on + off) * (NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_get_state()
H A Dpwm-apple.c57 state->duty_cycle, NSEC_PER_SEC); in apple_pwm_apply()
62 state->period, NSEC_PER_SEC) - on_cycles; in apple_pwm_apply()
91 state->duty_cycle = DIV64_U64_ROUND_UP((u64)on_cycles * NSEC_PER_SEC, fpwm->clkrate); in apple_pwm_get_state()
93 NSEC_PER_SEC, fpwm->clkrate); in apple_pwm_get_state()
131 if (fpwm->clkrate > NSEC_PER_SEC) in apple_pwm_probe()
H A Dpwm-axi-pwmgen.c88 mul_u64_u32_div(wf->period_length_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
102 mul_u64_u32_div(wf->duty_length_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
105 mul_u64_u32_div(wf->duty_offset_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
123 wf->period_length_ns = DIV64_U64_ROUND_UP((u64)wfhw->period_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
126 wf->duty_length_ns = DIV64_U64_ROUND_UP((u64)wfhw->duty_cycle_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
129 wf->duty_offset_ns = DIV64_U64_ROUND_UP((u64)wfhw->duty_offset_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
288 if (!ddata->clk_rate_hz || ddata->clk_rate_hz > NSEC_PER_SEC) in axi_pwmgen_probe()
H A Dpwm-sun4i.c131 state->period = DIV_ROUND_UP_ULL(NSEC_PER_SEC, clk_rate); in sun4i_pwm_get_state()
160 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); in sun4i_pwm_get_state()
163 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); in sun4i_pwm_get_state()
181 (state->period * clk_rate >= NSEC_PER_SEC) && in sun4i_pwm_calculate()
182 (state->period * clk_rate < 2 * NSEC_PER_SEC) && in sun4i_pwm_calculate()
183 (state->duty_cycle * clk_rate * 2 >= NSEC_PER_SEC); in sun4i_pwm_calculate()
197 div = clk_rate * state->period + NSEC_PER_SEC / 2; in sun4i_pwm_calculate()
198 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate()
214 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate()
H A Dpwm-sunplus.c84 if (clk_rate > (u64)SP7021_PWM_FREQ_SCALER * NSEC_PER_SEC) in sunplus_pwm_apply()
92 * NSEC_PER_SEC); in sunplus_pwm_apply()
117 (u64)dd_freq * NSEC_PER_SEC); in sunplus_pwm_apply()
146 * NSEC_PER_SEC, clk_rate); in sunplus_pwm_get_state()
150 state->duty_cycle = DIV64_U64_ROUND_UP((u64)dd_freq * (u64)duty * NSEC_PER_SEC, in sunplus_pwm_get_state()
H A Dpwm-xilinx.c55 return DIV64_U64_ROUND_UP(cycles * NSEC_PER_SEC, in xilinx_timer_get_period()
115 period_cycles = min_t(u64, state->period, U32_MAX * NSEC_PER_SEC); in xilinx_pwm_apply()
116 period_cycles = mul_u64_u32_div(period_cycles, rate, NSEC_PER_SEC); in xilinx_pwm_apply()
122 duty_cycles = min_t(u64, state->duty_cycle, U32_MAX * NSEC_PER_SEC); in xilinx_pwm_apply()
123 duty_cycles = mul_u64_u32_div(duty_cycles, rate, NSEC_PER_SEC); in xilinx_pwm_apply()
H A Dpwm-bcm2835.c84 max_period = DIV_ROUND_UP_ULL((u64)U32_MAX * NSEC_PER_SEC + NSEC_PER_SEC / 2, pc->rate) - 1; in bcm2835_pwm_apply()
90 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
99 val = DIV_ROUND_CLOSEST_ULL(state->duty_cycle * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
H A Dpwm-keembay.c110 low = FIELD_GET(KMB_PWM_LOW_MASK, highlow) * NSEC_PER_SEC; in keembay_pwm_get_state()
111 high = FIELD_GET(KMB_PWM_HIGH_MASK, highlow) * NSEC_PER_SEC; in keembay_pwm_get_state()
155 div = DIV_ROUND_DOWN_ULL(div, NSEC_PER_SEC); in keembay_pwm_apply()
161 div = DIV_ROUND_DOWN_ULL(div, NSEC_PER_SEC); in keembay_pwm_apply()
H A Dpwm-microchip-core.c141 * step_in_ns = (prescale * NSEC_PER_SEC) / clk_rate in mchp_core_pwm_calc_duty()
144 tmp = (((u64)prescale) + 1) * NSEC_PER_SEC; in mchp_core_pwm_calc_duty()
211 tmp = mul_u64_u64_div_u64(state->period, clk_rate, NSEC_PER_SEC); in mchp_core_pwm_calc_period()
250 * NSEC_PER_SEC * (0xfe + 1) in mchp_core_pwm_calc_period()
255 * NSEC_PER_SEC in mchp_core_pwm_calc_period()
263 * NSEC_PER_SEC * (prescale + 1) in mchp_core_pwm_calc_period()
294 if (clk_rate >= NSEC_PER_SEC) in mchp_core_pwm_apply_locked()
412 state->period *= NSEC_PER_SEC; in mchp_core_pwm_get_state()
425 state->duty_cycle = duty_steps * (prescale + 1) * NSEC_PER_SEC; in mchp_core_pwm_get_state()
/linux/tools/testing/selftests/timens/
H A Dfutex.c18 #define NSEC_PER_SEC 1000000000ULL macro
30 timeout.tv_nsec += NSEC_PER_SEC / 10; // 100ms in run_test()
31 if (timeout.tv_nsec > NSEC_PER_SEC) { in run_test()
33 timeout.tv_nsec -= NSEC_PER_SEC; in run_test()
/linux/arch/sparc/kernel/
H A Dvdso.c48 (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vsyscall()
50 ((u64)NSEC_PER_SEC) << tk->tkr_mono.shift; in update_vsyscall()
63 while (vdata->monotonic_time_coarse_nsec >= NSEC_PER_SEC) { in update_vsyscall()
64 vdata->monotonic_time_coarse_nsec -= NSEC_PER_SEC; in update_vsyscall()
/linux/drivers/md/bcache/
H A Dutil.c205 d->next += div_u64(done * NSEC_PER_SEC, atomic_long_read(&d->rate)); in bch_next_delay()
213 if (time_before64(now + NSEC_PER_SEC * 5LLU / 2LLU, d->next)) in bch_next_delay()
214 d->next = now + NSEC_PER_SEC * 5LLU / 2LLU; in bch_next_delay()
216 if (time_after64(now - NSEC_PER_SEC * 2, d->next)) in bch_next_delay()
217 d->next = now - NSEC_PER_SEC * 2; in bch_next_delay()
220 ? div_u64(d->next - now, NSEC_PER_SEC / HZ) in bch_next_delay()
/linux/fs/bcachefs/
H A Dtime_stats.c17 { "s", NSEC_PER_SEC },
18 { "m", (u64) NSEC_PER_SEC * 60},
19 { "h", (u64) NSEC_PER_SEC * 3600},
20 { "d", (u64) NSEC_PER_SEC * 3600 * 24},
21 { "w", (u64) NSEC_PER_SEC * 3600 * 24 * 7},
22 …{ "y", (u64) NSEC_PER_SEC * ((3600 * 24 * 7 * 365) + (3600 * (24 / 4) * 7))}, /* 365.25d …
/linux/tools/testing/selftests/net/
H A Dstress_reuseport_listen.c20 #define NSEC_PER_SEC 1000000000L macro
93 start_ns = start_ts.tv_sec * NSEC_PER_SEC + start_ts.tv_nsec; in main()
94 end_ns = end_ts.tv_sec * NSEC_PER_SEC + end_ts.tv_nsec; in main()
97 (end_ns - start_ns) / NSEC_PER_SEC, in main()
/linux/fs/proc/
H A Duptime.c31 idle.tv_sec = div_u64_rem(idle_nsec, NSEC_PER_SEC, &rem); in uptime_proc_show()
35 (uptime.tv_nsec / (NSEC_PER_SEC / 100)), in uptime_proc_show()
37 (idle.tv_nsec / (NSEC_PER_SEC / 100))); in uptime_proc_show()
/linux/drivers/rtc/
H A Drtc-goldfish.c38 do_div(rtc_alarm, NSEC_PER_SEC); in goldfish_rtc_read_alarm()
63 rtc_alarm64 = rtc_tm_to_time64(&alrm->time) * NSEC_PER_SEC; in goldfish_rtc_set_alarm()
125 do_div(time, NSEC_PER_SEC); in goldfish_rtc_read_time()
141 now64 = rtc_tm_to_time64(tm) * NSEC_PER_SEC; in goldfish_rtc_set_time()
179 rtcdrv->rtc->range_max = U64_MAX / NSEC_PER_SEC; in goldfish_rtc_probe()
/linux/drivers/clocksource/
H A Djcore-pit.c54 return seclo * NSEC_PER_SEC + nsec; in jcore_sched_clock_read()
113 freq = DIV_ROUND_CLOSEST(NSEC_PER_SEC, buspd); in jcore_pit_local_init()
114 pit->periodic_delta = DIV_ROUND_CLOSEST(NSEC_PER_SEC, HZ * buspd); in jcore_pit_local_init()
168 NSEC_PER_SEC, 400, 32, in jcore_pit_init()
175 sched_clock_register(jcore_sched_clock_read, 32, NSEC_PER_SEC); in jcore_pit_init()
/linux/tools/testing/selftests/kvm/x86_64/
H A Dkvm_clock_test.c
/linux/tools/testing/vsock/
H A Dvsock_perf.c32 #define NSEC_PER_SEC (1000000000ULL) macro
52 return (ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec; in current_nsec()
133 ((float)ns_delta / NSEC_PER_SEC); in get_gbps()
245 printf("total time in 'read()': %f sec\n", (float)in_read_ns / NSEC_PER_SEC); in run_receiver()
353 (float)tx_total_ns / NSEC_PER_SEC); in run_sender()
355 (float)time_in_send / NSEC_PER_SEC); in run_sender()
/linux/drivers/pps/generators/
H A Dpps_gen_parport.c78 lim = NSEC_PER_SEC - send_delay - dev->port_write_time; in hrtimer_event()
98 lim = NSEC_PER_SEC - dev->port_write_time; in hrtimer_event()
132 NSEC_PER_SEC - (send_delay + in hrtimer_event()
173 NSEC_PER_SEC - (send_delay + in next_intr_time()

12345678910>>...14