X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..fe8ab488e9161c46dd9885d58fc52996dc0249ff:/osfmk/kern/clock.c diff --git a/osfmk/kern/clock.c b/osfmk/kern/clock.c index 740f16340..1bd578496 100644 --- a/osfmk/kern/clock.c +++ b/osfmk/kern/clock.c @@ -33,7 +33,6 @@ #include -#include #include #include #include @@ -409,9 +408,11 @@ clock_set_calendar_microtime( clock_sec_t sys; clock_usec_t microsys; clock_sec_t newsecs; + clock_usec_t newmicrosecs; spl_t s; - newsecs = (microsecs < 500*USEC_PER_SEC)? secs: secs + 1; + newsecs = secs; + newmicrosecs = microsecs; s = splclock(); clock_lock(); @@ -447,7 +448,7 @@ clock_set_calendar_microtime( /* * Set the new value for the platform clock. */ - PESetGMTTimeOfDay(newsecs); + PESetUTCTimeOfDay(newsecs, newmicrosecs); splx(s); @@ -473,10 +474,12 @@ clock_set_calendar_microtime( void clock_initialize_calendar(void) { - clock_sec_t sys, secs = PEGetGMTTimeOfDay(); - clock_usec_t microsys, microsecs = 0; + clock_sec_t sys, secs; + clock_usec_t microsys, microsecs; spl_t s; + PEGetUTCTimeOfDay(&secs, µsecs); + s = splclock(); clock_lock(); @@ -1023,3 +1026,4 @@ clock_track_calend_nowait(void) } #endif /* CONFIG_DTRACE */ +