]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/rtclock.c
xnu-4570.41.2.tar.gz
[apple/xnu.git] / osfmk / i386 / rtclock.c
index d0a2ed840eaf034467d94eb19a4a845d67b43806..c8abc4b1eba22c88ca0d342f957f70fe99ec471f 100644 (file)
@@ -145,7 +145,7 @@ _rtc_nanotime_init(pal_rtc_nanotime_t *rntp, uint64_t base)
        _pal_rtc_nanotime_store(tsc, base, rntp->scale, rntp->shift, rntp);
 }
 
-static void
+void
 rtc_nanotime_init(uint64_t base)
 {
        _rtc_nanotime_init(&pal_rtc_nanotime_info, base);
@@ -265,6 +265,10 @@ rtc_sleep_wakeup(
        rtc_nanotime_init(base);
 }
 
+void
+rtc_decrementer_configure(void) {
+       rtc_timer->rtc_config();
+}
 /*
  * rtclock_early_init() is called very early at boot to
  * establish mach_absolute_time() and set it to zero.
@@ -398,21 +402,9 @@ clock_get_system_nanotime(
 }
 
 void
-clock_gettimeofday_set_commpage(
-       uint64_t                                abstime,
-       uint64_t                                epoch,
-       uint64_t                                offset,
-       clock_sec_t                             *secs,
-       clock_usec_t                    *microsecs)
+clock_gettimeofday_set_commpage(uint64_t abstime, uint64_t sec, uint64_t frac, uint64_t scale, uint64_t tick_per_sec)
 {
-       uint64_t        now = abstime + offset;
-       uint32_t        remain;
-
-       remain = _absolutetime_to_microtime(now, secs, microsecs);
-
-       *secs += (clock_sec_t)epoch;
-
-       commpage_set_timestamp(abstime - remain, *secs);
+       commpage_set_timestamp(abstime, sec, frac, scale, tick_per_sec);
 }
 
 void
@@ -491,6 +483,12 @@ mach_absolute_time(void)
        return rtc_nanotime_read();
 }
 
+uint64_t
+mach_approximate_time(void)
+{
+       return rtc_nanotime_read();
+}
+
 void
 clock_interval_to_absolutetime_interval(
        uint32_t                interval,