Lines Matching refs:nsec
470 struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec)
472 struct timespec64 ts = ns_to_timespec64(nsec);
483 * set_normalized_timespec64 - set timespec sec and nsec parts and normalize
487 * @nsec: nanoseconds to set
495 void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec)
497 while (nsec >= NSEC_PER_SEC) {
503 asm("" : "+rm"(nsec));
504 nsec -= NSEC_PER_SEC;
507 while (nsec < 0) {
508 asm("" : "+rm"(nsec));
509 nsec += NSEC_PER_SEC;
513 ts->tv_nsec = nsec;
519 * @nsec: the nanoseconds value to be converted
521 * Return: the timespec64 representation of the nsec parameter.
523 struct timespec64 ns_to_timespec64(s64 nsec)
528 if (likely(nsec > 0)) {
529 ts.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
531 } else if (nsec < 0) {
537 ts.tv_sec = -div_u64_rem(-nsec - 1, NSEC_PER_SEC, &rem) - 1;
603 * nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding.
611 * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec
620 long nsec = value->tv_nsec + TICK_NSEC - 1;
624 nsec = 0;
627 (((u64)nsec * NSEC_CONVERSION) >>
728 * nsec_to_clock_t - Convert nsec value to clock_t
729 * @x: nsec value
731 * Return: nsec value converted to 64-bit "clock_t" (CLOCKS_PER_SEC)