X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/eb6b6ca394357805f2bdba989abae309f718b4d8..f427ee49d309d8fc33ebf3042c3a775f2f530ded:/osfmk/i386/rtclock.c diff --git a/osfmk/i386/rtclock.c b/osfmk/i386/rtclock.c index bc6fa6524..08aed1af1 100644 --- a/osfmk/i386/rtclock.c +++ b/osfmk/i386/rtclock.c @@ -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); }