Lines Matching defs:nsec
465 struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec)
467 struct timespec64 ts = ns_to_timespec64(nsec);
478 * set_normalized_timespec64 - set timespec sec and nsec parts and normalize
482 * @nsec: nanoseconds to set
490 void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec)
492 while (nsec >= NSEC_PER_SEC) {
498 asm("" : "+rm"(nsec));
499 nsec -= NSEC_PER_SEC;
502 while (nsec < 0) {
503 asm("" : "+rm"(nsec));
504 nsec += NSEC_PER_SEC;
508 ts->tv_nsec = nsec;
514 * @nsec: the nanoseconds value to be converted
516 * Return: the timespec64 representation of the nsec parameter.
518 struct timespec64 ns_to_timespec64(s64 nsec)
523 if (likely(nsec > 0)) {
524 ts.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
526 } else if (nsec < 0) {
532 ts.tv_sec = -div_u64_rem(-nsec - 1, NSEC_PER_SEC, &rem) - 1;
598 * nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding.
606 * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec
615 long nsec = value->tv_nsec + TICK_NSEC - 1;
619 nsec = 0;
622 (((u64)nsec * NSEC_CONVERSION) >>
723 * nsec_to_clock_t - Convert nsec value to clock_t
724 * @x: nsec value
726 * Return: nsec value converted to 64-bit "clock_t" (CLOCKS_PER_SEC)