/openbmc/linux/tools/testing/selftests/timers/ |
H A D | valid-adjtimex.c | 34 #define NSEC_PER_SEC 1000000000LL macro 204 tmx.time.tv_sec = offset / NSEC_PER_SEC; in set_offset() 205 tmx.time.tv_usec = offset % NSEC_PER_SEC; in set_offset() 209 tmx.time.tv_usec += NSEC_PER_SEC; in set_offset() 256 if (set_offset(NSEC_PER_SEC - 1, 1)) in validate_set_offset() 259 if (set_offset(-NSEC_PER_SEC + 1, 1)) in validate_set_offset() 262 if (set_offset(-NSEC_PER_SEC - 1, 1)) in validate_set_offset() 265 if (set_offset(5 * NSEC_PER_SEC, 1)) in validate_set_offset() 268 if (set_offset(-5 * NSEC_PER_SEC, 1)) in validate_set_offset() 271 if (set_offset(5 * NSEC_PER_SEC + NSEC_PER_SEC / 2, 1)) in validate_set_offset() [all …]
|
H A D | nsleep-lat.c | 29 #define NSEC_PER_SEC 1000000000ULL macro 82 while (ts.tv_nsec >= NSEC_PER_SEC) { in timespec_add() 83 ts.tv_nsec -= NSEC_PER_SEC; in timespec_add() 92 long long ret = NSEC_PER_SEC * b.tv_sec + b.tv_nsec; in timespec_sub() 94 ret -= NSEC_PER_SEC * a.tv_sec + a.tv_nsec; in timespec_sub() 104 target.tv_sec = ns/NSEC_PER_SEC; in nanosleep_lat_test() 105 target.tv_nsec = ns%NSEC_PER_SEC; in nanosleep_lat_test() 161 while (length <= (NSEC_PER_SEC * 10)) { in main()
|
H A D | mqueue-lat.c | 34 #define NSEC_PER_SEC 1000000000ULL macro 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 | alarmtimer-suspend.c | 48 #define NSEC_PER_SEC 1000000000ULL macro 49 #define UNREASONABLE_LAT (NSEC_PER_SEC * 5) /* hopefully we resume in 5 secs */ 89 long long ret = NSEC_PER_SEC * b.tv_sec + b.tv_nsec; in timespec_sub() 91 ret -= NSEC_PER_SEC * a.tv_sec + a.tv_nsec; in timespec_sub() 106 delta_ns -= NSEC_PER_SEC * SUSPEND_SECS * alarmcount; in sigalarm()
|
H A D | raw_skew.c | 31 #define NSEC_PER_SEC 1000000000LL macro 48 return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec; in ts_to_nsec() 55 ts.tv_sec = ns/NSEC_PER_SEC; in nsec_to_ts() 56 ts.tv_nsec = ns%NSEC_PER_SEC; in nsec_to_ts() 127 eppm = ((delta2-delta1)*NSEC_PER_SEC)/interval; in main()
|
H A D | nanosleep.c | 32 #define NSEC_PER_SEC 1000000000ULL macro 94 while (ts.tv_nsec >= NSEC_PER_SEC) { in timespec_add() 95 ts.tv_nsec -= NSEC_PER_SEC; in timespec_add() 152 while (length <= (NSEC_PER_SEC * 10)) { in main()
|
H A D | adjtick.c | 30 #define NSEC_PER_SEC 1000000000LL macro 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()
|
/openbmc/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) 98 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) in timespec64_valid() 139 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; in timespec64_to_ns() 160 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); in timespec64_add_ns()
|
/openbmc/linux/kernel/time/ |
H A D | time.c | 497 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() 529 ts.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem); in ns_to_timespec64() 537 ts.tv_sec = -div_u64_rem(-nsec - 1, NSEC_PER_SEC, &rem) - 1; in ns_to_timespec64() 538 ts.tv_nsec = NSEC_PER_SEC - rem - 1; in ns_to_timespec64() 647 NSEC_PER_SEC, &rem); in jiffies_to_timespec64() 664 #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 in jiffies_to_clock_t() 671 return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ); in jiffies_to_clock_t() 707 #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 in jiffies_64_to_clock_t() [all …]
|
H A D | vsyscall.c | 39 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_data() 40 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_data() 55 while (nsec >= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { in update_vdso_data() 56 nsec -= (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift); in update_vdso_data() 101 vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec); in update_vsyscall()
|
/openbmc/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()
|
/openbmc/linux/tools/testing/selftests/mm/ |
H A D | ksm_tests.c | 600 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 …]
|
/openbmc/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()
|
/openbmc/linux/drivers/net/ethernet/marvell/octeontx2/af/ |
H A D | ptp.c | 131 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - ptp_clock_hi)); in ptp_reset_thresh() 134 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - delta_ns)); in ptp_reset_thresh() 147 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - start_ns)); in ptp_hrtimer_start() 168 return sec * NSEC_PER_SEC + nsec; in read_ptp_tstmp_sec_nsec() 194 cycle_time = NSEC_PER_SEC * CYCLE_MULT / ptp_clock_freq; in ptp_calc_adjusted_comp() 201 while (ptp_clock_nsec < NSEC_PER_SEC) { in ptp_calc_adjusted_comp() 208 ns_drift = ptp_clock_nsec - NSEC_PER_SEC; in ptp_calc_adjusted_comp() 259 writeq(timestamp / NSEC_PER_SEC, in ptp_atomic_update() 262 nxt_rollover_set = roundup(timestamp, NSEC_PER_SEC); in ptp_atomic_update() 263 curr_rollover_set = nxt_rollover_set - NSEC_PER_SEC; in ptp_atomic_update() [all …]
|
/openbmc/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()
|
/openbmc/linux/drivers/pwm/ |
H A D | pwm-apple.c | 58 state->duty_cycle, NSEC_PER_SEC); in apple_pwm_apply() 63 state->period, NSEC_PER_SEC) - on_cycles; in apple_pwm_apply() 92 state->duty_cycle = DIV64_U64_ROUND_UP((u64)on_cycles * NSEC_PER_SEC, fpwm->clkrate); in apple_pwm_get_state() 94 NSEC_PER_SEC, fpwm->clkrate); in apple_pwm_get_state() 130 if (fpwm->clkrate > NSEC_PER_SEC) in apple_pwm_probe()
|
H A D | pwm-sun4i.c | 132 state->period = DIV_ROUND_UP_ULL(NSEC_PER_SEC, clk_rate); in sun4i_pwm_get_state() 161 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); in sun4i_pwm_get_state() 164 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); in sun4i_pwm_get_state() 182 (state->period * clk_rate >= NSEC_PER_SEC) && in sun4i_pwm_calculate() 183 (state->period * clk_rate < 2 * NSEC_PER_SEC) && in sun4i_pwm_calculate() 184 (state->duty_cycle * clk_rate * 2 >= NSEC_PER_SEC); in sun4i_pwm_calculate() 198 div = clk_rate * state->period + NSEC_PER_SEC / 2; in sun4i_pwm_calculate() 199 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate() 215 do_div(div, NSEC_PER_SEC); in sun4i_pwm_calculate()
|
H A D | pwm-sunplus.c | 85 if (clk_rate > (u64)SP7021_PWM_FREQ_SCALER * NSEC_PER_SEC) in sunplus_pwm_apply() 93 * NSEC_PER_SEC); in sunplus_pwm_apply() 118 (u64)dd_freq * NSEC_PER_SEC); in sunplus_pwm_apply() 147 * NSEC_PER_SEC, clk_rate); in sunplus_pwm_get_state() 151 state->duty_cycle = DIV64_U64_ROUND_UP((u64)dd_freq * (u64)duty * NSEC_PER_SEC, in sunplus_pwm_get_state()
|
/openbmc/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()
|
/openbmc/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()
|
/openbmc/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()
|
/openbmc/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()
|
/openbmc/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() 345 tx.time.tv_usec += NSEC_PER_SEC; in main() 482 perout_request.period.sec = perout / NSEC_PER_SEC; in main() 483 perout_request.period.nsec = perout % NSEC_PER_SEC; in main() 487 perout_request.on.sec = pulsewidth / NSEC_PER_SEC; in main() 488 perout_request.on.nsec = pulsewidth % NSEC_PER_SEC; in main() 492 perout_request.phase.sec = perout_phase / NSEC_PER_SEC; in main() 493 perout_request.phase.nsec = perout_phase % NSEC_PER_SEC; in main()
|
/openbmc/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() 156 NSEC_PER_SEC, 400, 32, in jcore_pit_init() 163 sched_clock_register(jcore_sched_clock_read, 32, NSEC_PER_SEC); in jcore_pit_init()
|