This source file includes following definitions.
- pmix_sys_timer_get_cycles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef PMIX_SYS_ARCH_TIMER_H
20 #define PMIX_SYS_ARCH_TIMER_H 1
21
22
23 typedef uint64_t pmix_timer_t;
24
25
26 #if PMIX_GCC_INLINE_ASSEMBLY
27
28 static inline pmix_timer_t
29 pmix_sys_timer_get_cycles(void)
30 {
31 unsigned int tbl, tbu0, tbu1;
32
33 do {
34 __asm__ __volatile__ ("mftbu %0" : "=r"(tbu0));
35 __asm__ __volatile__ ("mftb %0" : "=r"(tbl));
36 __asm__ __volatile__ ("mftbu %0" : "=r"(tbu1));
37 } while (tbu0 != tbu1);
38
39 return (((unsigned long long)tbu0) << 32) | tbl;
40 }
41
42 #define PMIX_HAVE_SYS_TIMER_GET_CYCLES 1
43
44 #else
45
46 pmix_timer_t pmix_sys_timer_get_cycles(void);
47
48 #define PMIX_HAVE_SYS_TIMER_GET_CYCLES 1
49
50 #endif
51
52 #endif