X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Fust%2Fclock.h;h=22d2efc65c9666905ff896d0fac4c89a8bbd2462;hb=13ef5c0efe5894668297bfa10f1304c40866c054;hp=04785fc34e7bf1154fa725129db3a0af20ba5668;hpb=08b070db024044d21779c63f721673e06032eff8;p=lttng-ust.git diff --git a/include/ust/clock.h b/include/ust/clock.h index 04785fc3..22d2efc6 100644 --- a/include/ust/clock.h +++ b/include/ust/clock.h @@ -39,7 +39,6 @@ precision and monotonicity. */ -#if __i386__ || __x86_64__ /* Only available for x86 arch */ #define CLOCK_TRACE_FREQ 14 #define CLOCK_TRACE 15 @@ -47,36 +46,10 @@ union lttng_timespec { struct timespec ts; u64 lttng_ts; }; -#endif /* __i386__ || __x86_64__ */ 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) { @@ -101,8 +74,7 @@ static __inline__ u64 trace_clock_read64(void) return retval; } -#endif /* __PPC__ */ - +#if __i386__ || __x86_64__ static __inline__ u64 trace_clock_frequency(void) { struct timespec ts; @@ -114,6 +86,12 @@ static __inline__ u64 trace_clock_frequency(void) } return 1000000000LL; } +#else /* #if __i386__ || __x86_64__ */ +static __inline__ u64 trace_clock_frequency(void) +{ + return 1000000000LL; +} +#endif /* #else #if __i386__ || __x86_64__ */ static __inline__ u32 trace_clock_freq_scale(void) {