-/*
- * rtc_nanotime_update:
- *
- * Update the nanotime info from the base time. Since
- * the base value might be from a lower resolution clock,
- * we compare it to the TSC derived value, and use the
- * greater of the two values.
- *
- * N.B. In comparison to the above init routine, this assumes
- * that the TSC has remained monotonic compared to the tsc_base
- * value, which is not the case after S3 sleep.
- */
-static inline void
-_rtc_nanotime_update(rtc_nanotime_t *rntp, uint64_t base)
-{
- uint64_t nsecs, tsc = rdtsc64();
-
- nsecs = rntp->ns_base + _tsc_to_nanoseconds(tsc - rntp->tsc_base);
- rtc_nanotime_store(tsc, MAX(nsecs, base), rntp->scale, rntp->shift, rntp);
-}
-
-static void
-rtc_nanotime_update(
- uint64_t base)
-{
- rtc_nanotime_t *rntp = &rtc_nanotime_info;
-
- assert(!ml_get_interrupts_enabled());
-
- _rtc_nanotime_update(rntp, base);
- rtc_nanotime_set_commpage(rntp);
-}
-