]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/rtclock.c
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / osfmk / i386 / rtclock.c
index bc6fa6524b9d48e82c5213f8d69cb71d462815ab..08aed1af14e670bf365c2af867196da1dc15c2ff 100644 (file)
@@ -75,6 +75,11 @@ int             rtclock_init(void);
 
 uint64_t        tsc_rebase_abs_time = 0;
 
+volatile uint64_t gAcpiLastSleepTscBase = 0;
+volatile uint64_t gAcpiLastSleepNanoBase = 0;
+volatile uint64_t gAcpiLastWakeTscBase = 0;
+volatile uint64_t gAcpiLastWakeNanoBase = 0;
+
 static void     rtc_set_timescale(uint64_t cycles);
 static uint64_t rtc_export_speed(uint64_t cycles);
 
@@ -148,7 +153,14 @@ _rtc_nanotime_init(pal_rtc_nanotime_t *rntp, uint64_t base)
 void
 rtc_nanotime_init(uint64_t base)
 {
+       gAcpiLastSleepTscBase = pal_rtc_nanotime_info.tsc_base;
+       gAcpiLastSleepNanoBase = pal_rtc_nanotime_info.ns_base;
+
        _rtc_nanotime_init(&pal_rtc_nanotime_info, base);
+
+       gAcpiLastWakeTscBase = pal_rtc_nanotime_info.tsc_base;
+       gAcpiLastWakeNanoBase = pal_rtc_nanotime_info.ns_base;
+
        rtc_nanotime_set_commpage(&pal_rtc_nanotime_info);
 }