Privatize headers
[ust.git] / include / ust / clock.h
index ac0a2d5a9e1453460f4225f968d0496d059c3633..5e8f755b9c08573d1fd7ec110156fe3ea71bdaf4 100644 (file)
@@ -20,7 +20,9 @@
 
 #include <time.h>
 #include <sys/time.h>
-#include <ust/kcompat/kcompat.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <ust/core.h>
 
 /* TRACE CLOCK */
 
    precision and monotonicity.
 */
 
-#if __i386__ || __x86_64__
 /* Only available for x86 arch */
 #define CLOCK_TRACE_FREQ  14
 #define CLOCK_TRACE  15
 union lttng_timespec {
        struct timespec ts;
-       u64 lttng_ts;
+       uint64_t lttng_ts;
 };
-#endif /* __i386__ || __x86_64__ */
 
-static int ust_clock_source;
+extern int ust_clock_source;
 
 /* Choosing correct trace clock */
-#if __PPC__
-static __inline__ u64 trace_clock_read64(void)
-{
-       unsigned long tb_l;
-       unsigned long tb_h;
-       unsigned long tb_h2;
-       u64 tb;
-
-       __asm__ (
-               "1:\n\t"
-               "mftbu %[rhigh]\n\t"
-               "mftb %[rlow]\n\t"
-               "mftbu %[rhigh2]\n\t"
-               "cmpw %[rhigh],%[rhigh2]\n\t"
-               "bne 1b\n\t"
-               : [rhigh] "=r" (tb_h), [rhigh2] "=r" (tb_h2), [rlow] "=r" (tb_l));
-
-       tb = tb_h;
-       tb <<= 32;
-       tb |= tb_l;
-
-       return tb;
-}
 
-#else  /* !__PPC__ */
-
-static __inline__ u64 trace_clock_read64(void)
+static __inline__ uint64_t trace_clock_read64(void)
 {
        struct timespec ts;
-       u64 retval;
+       uint64_t retval;
        union lttng_timespec *lts = (union lttng_timespec *) &ts;
 
        clock_gettime(ust_clock_source, &ts);
@@ -101,9 +76,8 @@ static __inline__ u64 trace_clock_read64(void)
        return retval;
 }
 
-#endif /* __PPC__ */
-
-static __inline__ u64 trace_clock_frequency(void)
+#if __i386__ || __x86_64__
+static __inline__ uint64_t trace_clock_frequency(void)
 {
        struct timespec ts;
        union lttng_timespec *lts = (union lttng_timespec *) &ts;
@@ -114,8 +88,14 @@ static __inline__ u64 trace_clock_frequency(void)
        }
        return 1000000000LL;
 }
+#else /* #if __i386__ || __x86_64__ */
+static __inline__ uint64_t trace_clock_frequency(void)
+{
+       return 1000000000LL;
+}
+#endif /* #else #if __i386__ || __x86_64__ */
 
-static __inline__ u32 trace_clock_freq_scale(void)
+static __inline__ uint32_t trace_clock_freq_scale(void)
 {
        return 1;
 }
This page took 0.025877 seconds and 4 git commands to generate.