68 #if defined(__powerpc64__)
69 #define __TIME_BASE(__time_v) \
72 __asm__ __volatile__ ( \
77 #elif defined(__powerpc__)
78 #define __TIME_BASE(__time_v) \
80 unsigned long __tbu, __tbl, __tmp; \
88 : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp) ); \
89 __time_v = (( (sphtimer_t) __tbu << 32) | __tbl); \
91 #elif defined(__x86_64__) && defined(__x86_64_INVARIANT_TSC)
96 #define __TIME_BASE(__time_v) \
98 unsigned int __t_hi, __t_lo; \
99 __asm__ __volatile__ ( \
103 __time_v = ((sphtimer_t) __t_hi << 32) | __t_lo; \
105 #elif defined(__i386__) && defined(__x86_INVARIANT_TSC)
110 #define __TIME_BASE(__time_v) \
113 __asm__ __volatile__ ( \
121 #define __TIME_BASE(__time_v) \
123 struct timespec __ts; \
125 clock_gettime (CLOCK_MONOTONIC, &__ts); \
126 __t = ((sphtimer_t)__ts.tv_sec * 1000000000L) \
127 + (sphtimer_t)__ts.tv_nsec; \
178 if (__builtin_expect ((result == 0), 0))
unsigned long long int sphtimer_t
Value from TB/TSC register (64-bits on all platforms).
Definition: sphtimer.h:66
static sphtimer_t sphgettimer(void)
Read and return the Timebase value.
Definition: sphtimer.h:139
#define __TIME_BASE(__time_v)
Read the Time Base value.
Definition: sphtimer.h:121
#define __C__
ignore this macro behind the curtain.
Definition: sphtimer.h:60
sphtimer_t sph_cpu_frequency
Frequency which Timebase is updated by system.
static sphtimer_t sphfastcpufreq(void)
Return the Timebase update frequency (fast version).
Definition: sphtimer.h:174
__C__ sphtimer_t sphgetcpufreq(void)
Return the Timebase update frequency.