]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/timer.c
xnu-4570.20.62.tar.gz
[apple/xnu.git] / osfmk / kern / timer.c
index b53419857ecfce18f4624962c99013e84d818974..f101eb17142ac9218c0382b51c2d127d2789cc4b 100644 (file)
@@ -56,9 +56,6 @@
 /* 
  */
 
-#include <stat_time.h>
-#include <machine_timer_routines.h>
-
 #include <mach/kern_return.h>
 #include <mach/port.h>
 #include <kern/queue.h>
 #include <kern/sched_prim.h>
 #include <kern/timer.h>
 
+#if CONFIG_EMBEDDED
+int precise_user_kernel_time = 0;
+#else
+int precise_user_kernel_time = 1;
+#endif
+
 /*
  *     timer_init initializes a timer.
  */
@@ -74,12 +77,14 @@ void
 timer_init(
        timer_t         timer)
 {
-#if    !STAT_TIME
        timer->tstamp = 0;
-#endif /* STAT_TIME */
+#if    defined(__LP64__)
+       timer->all_bits = 0;
+#else
        timer->low_bits = 0;
        timer->high_bits = 0;
        timer->high_bits_check = 0;
+#endif /* defined(__LP64__) */
 }
 
 /*
@@ -103,17 +108,19 @@ timer_advance(
        timer_t         timer,
        uint64_t        delta)
 {
+#if    defined(__LP64__)
+       timer->all_bits += delta;
+#else
        uint64_t        low;
 
        low = delta + timer->low_bits;
        if (low >> 32)
-               timer_update(timer, timer->high_bits + (low >> 32), low);
+               timer_update(timer, (uint32_t)(timer->high_bits + (low >> 32)), (uint32_t)low);
        else
-               timer->low_bits = low;
+               timer->low_bits = (uint32_t)low;
+#endif         /* defined(__LP64__) */
 }
 
-#if    !STAT_TIME
-
 void
 timer_start(
        timer_t         timer,
@@ -143,14 +150,6 @@ timer_switch(
        new_timer->tstamp = tstamp;
 }
 
-#if    MACHINE_TIMER_ROUTINES
-
-/*
- *     Machine-dependent code implements the timer event routine.
- */
-
-#else  /* MACHINE_TIMER_ROUTINES */
-
 /*
  *     Update the current thread timer and
  *     start the new timer.  Requires a current
@@ -178,7 +177,3 @@ thread_timer_event(
        PROCESSOR_DATA(processor, thread_timer) = new_timer;
        new_timer->tstamp = tstamp;
 }
-
-#endif /* MACHINE_TIMER_ROUTINES */
-
-#endif /* STAT_TIME */