Lines Matching refs:nsec
452 struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec)
454 struct timespec64 ts = ns_to_timespec64(nsec);
465 * set_normalized_timespec - set timespec sec and nsec parts and normalize
469 * @nsec: nanoseconds to set
478 void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec)
480 while (nsec >= NSEC_PER_SEC) {
486 asm("" : "+rm"(nsec));
487 nsec -= NSEC_PER_SEC;
490 while (nsec < 0) {
491 asm("" : "+rm"(nsec));
492 nsec += NSEC_PER_SEC;
496 ts->tv_nsec = nsec;
502 * @nsec: the nanoseconds value to be converted
504 * Returns the timespec64 representation of the nsec parameter.
506 struct timespec64 ns_to_timespec64(const s64 nsec)
511 if (likely(nsec > 0)) {
512 ts.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
514 } else if (nsec < 0) {
520 ts.tv_sec = -div_u64_rem(-nsec - 1, NSEC_PER_SEC, &rem) - 1;
575 * nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding.
583 * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec
591 long nsec = value->tv_nsec + TICK_NSEC - 1;
595 nsec = 0;
598 (((u64)nsec * NSEC_CONVERSION) >>