Home
last modified time | relevance | path

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

12345678910>>...19

/linux-6.15/tools/testing/selftests/timers/
H A Dvalid-adjtimex.c202 tmx.time.tv_sec = offset / NSEC_PER_SEC; in set_offset()
207 tmx.time.tv_usec += NSEC_PER_SEC; in set_offset()
254 if (set_offset(NSEC_PER_SEC - 1, 1)) in validate_set_offset()
257 if (set_offset(-NSEC_PER_SEC + 1, 1)) in validate_set_offset()
260 if (set_offset(-NSEC_PER_SEC - 1, 1)) in validate_set_offset()
263 if (set_offset(5 * NSEC_PER_SEC, 1)) in validate_set_offset()
266 if (set_offset(-5 * NSEC_PER_SEC, 1)) in validate_set_offset()
269 if (set_offset(5 * NSEC_PER_SEC + NSEC_PER_SEC / 2, 1)) in validate_set_offset()
272 if (set_offset(-5 * NSEC_PER_SEC - NSEC_PER_SEC / 2, 1)) in validate_set_offset()
305 if (set_bad_offset(0, NSEC_PER_SEC, 1)) in validate_set_offset()
[all …]
H A Dnsleep-lat.c69 while (ts.tv_nsec >= NSEC_PER_SEC) { in timespec_add()
70 ts.tv_nsec -= NSEC_PER_SEC; in timespec_add()
79 long long ret = NSEC_PER_SEC * b.tv_sec + b.tv_nsec; in timespec_sub()
81 ret -= NSEC_PER_SEC * a.tv_sec + a.tv_nsec; in timespec_sub()
91 target.tv_sec = ns/NSEC_PER_SEC; in nanosleep_lat_test()
92 target.tv_nsec = ns%NSEC_PER_SEC; in nanosleep_lat_test()
149 while (length <= (NSEC_PER_SEC * 10)) { in main()
H A Dmqueue-lat.c42 long long ret = NSEC_PER_SEC * b.tv_sec + b.tv_nsec; in timespec_sub()
44 ret -= NSEC_PER_SEC * a.tv_sec + a.tv_nsec; in timespec_sub()
51 while (ts.tv_nsec >= NSEC_PER_SEC) { in timespec_add()
52 ts.tv_nsec -= NSEC_PER_SEC; in timespec_add()
H A Dalarmtimer-suspend.c35 #define UNREASONABLE_LAT (NSEC_PER_SEC * 5) /* hopefully we resume in 5 secs */
75 long long ret = NSEC_PER_SEC * b.tv_sec + b.tv_nsec; in timespec_sub()
77 ret -= NSEC_PER_SEC * a.tv_sec + a.tv_nsec; in timespec_sub()
92 delta_ns -= NSEC_PER_SEC * SUSPEND_SECS * alarmcount; in sigalarm()
H A Draw_skew.c46 return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec; in ts_to_nsec()
53 ts.tv_sec = ns/NSEC_PER_SEC; in nsec_to_ts()
54 ts.tv_nsec = ns%NSEC_PER_SEC; in nsec_to_ts()
125 eppm = ((delta2-delta1)*NSEC_PER_SEC)/interval; in main()
/linux-6.15/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()
144 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; in timespec64_to_ns()
165 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); in timespec64_add_ns()
/linux-6.15/kernel/time/
H A Dtime.c497 while (nsec >= NSEC_PER_SEC) { in set_normalized_timespec64()
504 nsec -= NSEC_PER_SEC; in set_normalized_timespec64()
509 nsec += NSEC_PER_SEC; in set_normalized_timespec64()
538 ts.tv_nsec = NSEC_PER_SEC - rem - 1; in ns_to_timespec64()
647 NSEC_PER_SEC, &rem); in jiffies_to_timespec64()
735 #if (NSEC_PER_SEC % USER_HZ) == 0 in nsec_to_clock_t()
736 return div_u64(x, NSEC_PER_SEC / USER_HZ); in nsec_to_clock_t()
757 #if !(NSEC_PER_SEC % HZ) in jiffies64_to_nsecs()
758 return (NSEC_PER_SEC / HZ) * j; in jiffies64_to_nsecs()
798 #if (NSEC_PER_SEC % HZ) == 0 in nsecs_to_jiffies64()
[all …]
H A Dvsyscall.c45 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_time_data()
46 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_time_data()
61 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_time_data()
62 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_time_data()
108 vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec); in update_vsyscall()
/linux-6.15/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-6.15/tools/testing/selftests/mm/
H A Dksm_tests.c604 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()
646 scan_time_ns % NSEC_PER_SEC); in ksm_merge_time()
648 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_merge_time()
693 scan_time_ns % NSEC_PER_SEC); in ksm_unmerge_time()
695 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_unmerge_time()
736 cow_time_ns % NSEC_PER_SEC); in ksm_cow_time()
738 ((double)cow_time_ns / NSEC_PER_SEC)); in ksm_cow_time()
764 cow_time_ns % NSEC_PER_SEC); in ksm_cow_time()
[all …]
/linux-6.15/drivers/net/ethernet/marvell/octeontx2/af/
H A Dptp.c169 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()
286 if (delta < NSEC_PER_SEC) in ptp_atomic_adjtime()
473 if (cn10k_ptp_errata(ptp) && period != NSEC_PER_SEC) { in ptp_pps_on()
478 if (period > (8 * NSEC_PER_SEC)) { in ptp_pps_on()
[all …]
/linux-6.15/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-sophgo-sg2042.c88 period_ticks = min(mul_u64_u64_div_u64(ddata->clk_rate_hz, state->period, NSEC_PER_SEC), U32_MAX); in pwm_sg2042_apply()
89 …hlperiod_ticks = min(mul_u64_u64_div_u64(ddata->clk_rate_hz, state->duty_cycle, NSEC_PER_SEC), U32… in pwm_sg2042_apply()
119 state->period = DIV_ROUND_UP_ULL((u64)period_ticks * NSEC_PER_SEC, ddata->clk_rate_hz); in pwm_sg2042_get_state()
120 state->duty_cycle = DIV_ROUND_UP_ULL((u64)hlperiod_ticks * NSEC_PER_SEC, ddata->clk_rate_hz); in pwm_sg2042_get_state()
165 if (!ddata->clk_rate_hz || ddata->clk_rate_hz > NSEC_PER_SEC) in pwm_sg2042_probe()
H A Dpwm-axi-pwmgen.c89 mul_u64_u32_div(wf->period_length_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
106 mul_u64_u32_div(wf->duty_length_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
109 mul_u64_u32_div(wf->duty_offset_ns, ddata->clk_rate_hz, NSEC_PER_SEC), in axi_pwmgen_round_waveform_tohw()
127 wf->period_length_ns = DIV64_U64_ROUND_UP((u64)wfhw->period_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
130 wf->duty_length_ns = DIV64_U64_ROUND_UP((u64)wfhw->duty_cycle_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
133 wf->duty_offset_ns = DIV64_U64_ROUND_UP((u64)wfhw->duty_offset_cnt * NSEC_PER_SEC, in axi_pwmgen_round_waveform_fromhw()
292 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()
/linux-6.15/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-6.15/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-6.15/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-6.15/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-6.15/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-6.15/fs/bcachefs/
H A Dtime_stats.c20 { "s", NSEC_PER_SEC },
21 { "m", (u64) NSEC_PER_SEC * 60},
22 { "h", (u64) NSEC_PER_SEC * 3600},
23 { "d", (u64) NSEC_PER_SEC * 3600 * 24},
24 { "w", (u64) NSEC_PER_SEC * 3600 * 24 * 7},
25 …{ "y", (u64) NSEC_PER_SEC * ((3600 * 24 * 7 * 365) + (3600 * (24 / 4) * 7))}, /* 365.25d …
/linux-6.15/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-6.15/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()

12345678910>>...19