File tree Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 1616#ifndef OPAL_SYS_ARCH_TIMER_H
1717#define OPAL_SYS_ARCH_TIMER_H 1
1818
19- #include <sys/times.h>
20-
2119typedef uint64_t opal_timer_t ;
2220
2321static inline opal_timer_t
@@ -33,13 +31,14 @@ opal_sys_timer_get_cycles(void)
3331
3432
3533static inline opal_timer_t
36- opal_sys_timer_freq (void )
34+ opal_sys_timer_get_freq (void )
3735{
3836 opal_timer_t freq ;
3937 __asm__ __volatile__ ("mrs %0, CNTFRQ_EL0" : "=r" (freq ));
4038 return (opal_timer_t )(freq );
4139}
4240
4341#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
42+ #define OPAL_HAVE_SYS_TIMER_GET_FREQ 1
4443
4544#endif /* ! OPAL_SYS_ARCH_TIMER_H */
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ opal_sys_timer_get_cycles(void)
4949
5050#else
5151
52- opal_timer_t opal_sys_timer_get_cycles (void );
53-
54- #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
52+ #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
5553
5654#endif /* OPAL_GCC_INLINE_ASSEMBLY */
5755
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ opal_sys_timer_get_cycles(void)
4343
4444#else
4545
46- opal_timer_t opal_sys_timer_get_cycles (void );
47-
48- #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
46+ #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
4947
5048#endif /* OPAL_GCC_INLINE_ASSEMBLY */
5149
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ BEGIN_C_DECLS
9898
9999typedef long opal_timer_t ;
100100#endif
101+
102+ #ifndef OPAL_HAVE_SYS_TIMER_GET_FREQ
103+ #define OPAL_HAVE_SYS_TIMER_GET_FREQ 0
104+ #endif
101105#endif
102106
103107#ifndef OPAL_HAVE_SYS_TIMER_IS_MONOTONIC
Original file line number Diff line number Diff line change @@ -65,9 +65,7 @@ static inline bool opal_sys_timer_is_monotonic (void)
6565
6666#else
6767
68- opal_timer_t opal_sys_timer_get_cycles (void );
69-
70- #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
68+ #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
7169
7270#endif /* OPAL_GCC_INLINE_ASSEMBLY */
7371
Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ static int opal_timer_linux_find_freq(void)
117117
118118 opal_timer_linux_freq = 0 ;
119119
120- #if OPAL_ASSEMBLY_ARCH == OPAL_ARM64
121- opal_timer_linux_freq = opal_sys_timer_freq ();
120+ #if OPAL_HAVE_SYS_TIMER_GET_FREQ
121+ opal_timer_linux_freq = opal_sys_timer_get_freq ();
122122#endif
123123
124124 if (0 == opal_timer_linux_freq ) {
You can’t perform that action at this time.
0 commit comments