| /linux/tools/testing/selftests/timers/ |
| H A D | valid-adjtimex.c | 202 tmx.time.tv_sec = offset / NSEC_PER_SEC; in set_offset() 203 tmx.time.tv_usec = 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() [all …]
|
| H A D | nsleep-lat.c | 69 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 D | mqueue-lat.c | 42 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 D | nanosleep.c | 82 while (ts.tv_nsec >= NSEC_PER_SEC) { in timespec_add() 83 ts.tv_nsec -= NSEC_PER_SEC; in timespec_add() 141 itimer.it_value.tv_nsec = NSEC_PER_SEC / 4; in nanosleep_test_remaining() 146 rqtp.tv_nsec = NSEC_PER_SEC / 2; in nanosleep_test_remaining() 191 while (length <= (NSEC_PER_SEC * 10)) { in main()
|
| H A D | alarmtimer-suspend.c | 35 #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 D | raw_skew.c | 46 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/include/linux/ |
| H A D | acct.h | 69 #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 D | time64.h | 32 #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/kernel/time/ |
| H A D | time.c | 492 while (nsec >= NSEC_PER_SEC) { in set_normalized_timespec64() 499 nsec -= NSEC_PER_SEC; in set_normalized_timespec64() 504 nsec += NSEC_PER_SEC; in set_normalized_timespec64() 524 ts.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem); in ns_to_timespec64() 532 ts.tv_sec = -div_u64_rem(-nsec - 1, NSEC_PER_SEC, &rem) - 1; in ns_to_timespec64() 533 ts.tv_nsec = NSEC_PER_SEC - rem - 1; in ns_to_timespec64() 642 NSEC_PER_SEC, &rem); in jiffies_to_timespec64() 659 #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 in jiffies_to_clock_t() 666 return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ); in jiffies_to_clock_t() 702 #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 in jiffies_64_to_clock_t() [all …]
|
| H A D | vsyscall.c | 44 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_time_data() 45 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_time_data() 60 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_time_data() 61 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_time_data() 107 vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec); in update_vsyscall() 166 vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &nsec); in vdso_time_update_aux()
|
| /linux/tools/testing/selftests/mm/ |
| H A D | ksm_tests.c | 578 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_merge_hugepages_time() 582 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_merge_hugepages_time() 583 scan_time_ns % NSEC_PER_SEC); in ksm_merge_hugepages_time() 585 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_merge_hugepages_time() 619 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_merge_time() 623 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_merge_time() 624 scan_time_ns % NSEC_PER_SEC); in ksm_merge_time() 626 ((double)scan_time_ns / NSEC_PER_SEC)); in ksm_merge_time() 666 scan_time_ns = (end_time.tv_sec - start_time.tv_sec) * NSEC_PER_SEC + in ksm_unmerge_time() 670 printf("Total time: %ld.%09ld s\n", scan_time_ns / NSEC_PER_SEC, in ksm_unmerge_time() [all …]
|
| /linux/tools/testing/radix-tree/ |
| H A D | benchmark.c | 12 #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/drivers/net/ethernet/marvell/octeontx2/af/ |
| H A D | ptp.c | 132 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 D | pwm-adp5585.c | 33 #define ADP5585_PWM_MIN_PERIOD_NS (2ULL * NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ) 34 #define ADP5585_PWM_MAX_PERIOD_NS (2ULL * 0xffff * NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ) 97 on = div_u64(duty_cycle, NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_apply() 98 off = div_u64(period, NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ) - on; in pwm_adp5585_apply() 142 state->duty_cycle = on * (NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_get_state() 143 state->period = (on + off) * (NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_get_state()
|
| H A D | pwm-apple.c | 57 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 D | pwm-axi-pwmgen.c | 89 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() 309 if (!ddata->clk_rate_hz || ddata->clk_rate_hz > NSEC_PER_SEC) in axi_pwmgen_probe()
|
| H A D | pwm-sun4i.c | 129 state->period = DIV_ROUND_UP_ULL(NSEC_PER_SEC, clk_rate); in sun4i_pwm_get_state() 158 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); in sun4i_pwm_get_state() 161 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); in sun4i_pwm_get_state() 179 (state->period * clk_rate >= NSEC_PER_SEC) && in sun4i_pwm_calculate() 180 (state->period * clk_rate < 2 * NSEC_PER_SEC) && in sun4i_pwm_calculate() 181 (state->duty_cycle * clk_rate * 2 >= NSEC_PER_SEC); in sun4i_pwm_calculate() 195 div = clk_rate * state->period + NSEC_PER_SEC / 2; in sun4i_pwm_calculate() 196 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate() 212 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate()
|
| /linux/tools/testing/selftests/timens/ |
| H A D | futex.c | 18 #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 D | vdso.c | 48 (((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 D | util.c | 205 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/tools/testing/selftests/net/ |
| H A D | stress_reuseport_listen.c | 20 #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/drivers/rtc/ |
| H A D | rtc-goldfish.c | 38 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/fs/proc/ |
| H A D | uptime.c | 31 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/tools/testing/selftests/ptp/ |
| H A D | testptp.c | 38 #define NSEC_PER_SEC 1000000000LL macro 113 return t->sec * NSEC_PER_SEC + t->nsec; in pctns() 379 tx.time.tv_usec += NSEC_PER_SEC; in main() 520 perout_request.period.sec = perout / NSEC_PER_SEC; in main() 521 perout_request.period.nsec = perout % NSEC_PER_SEC; in main() 525 perout_request.on.sec = pulsewidth / NSEC_PER_SEC; in main() 526 perout_request.on.nsec = pulsewidth % NSEC_PER_SEC; in main() 530 perout_request.phase.sec = perout_phase / NSEC_PER_SEC; in main() 531 perout_request.phase.nsec = perout_phase % NSEC_PER_SEC; in main()
|
| /linux/drivers/clocksource/ |
| H A D | jcore-pit.c | 54 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()
|