Skip to content

Commit

Permalink
CONFIG/UCS/ARCH: Check for __ppc_get_timebase/__ppc_get_timbase_freq …
Browse files Browse the repository at this point in the history
…functions too
  • Loading branch information
dmitrygx committed Nov 3, 2021
1 parent ac6bc97 commit 45d5367
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions config/m4/sysdep.m4
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,24 @@ AC_CHECK_DECLS([ethtool_cmd_speed, SPEED_UNKNOWN], [], [],
[#include <linux/ethtool.h>])


#
# PowerPC "sys/platform/ppc.h" header
#
AC_CHECK_HEADERS([sys/platform/ppc.h])


#
# PowerPC query for getting TB frequency
#
AC_CHECK_DECLS([__ppc_get_timebase_freq], [], [], [#include <sys/platform/ppc.h>])
AC_CHECK_HEADERS([sys/platform/ppc.h])
AC_CHECK_FUNCS([__ppc_get_timebase_freq])


#
# PowerPC query for getting TB
#
AC_CHECK_DECLS([__ppc_get_timebase], [], [], [#include <sys/platform/ppc.h>])
AC_CHECK_HEADERS([sys/platform/ppc.h])
AC_CHECK_FUNCS([__ppc_get_timebase])


#
Expand Down
2 changes: 1 addition & 1 deletion src/ucs/arch/ppc64/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BEGIN_C_DECLS

static inline uint64_t ucs_arch_read_hres_clock()
{
#if HAVE_DECL___PPC_GET_TIMEBASE
#if HAVE_DECL___PPC_GET_TIMEBASE && defined(HAVE___PPC_GET_TIMEBASE)
return __ppc_get_timebase();
#else
uint64_t tb;
Expand Down
2 changes: 1 addition & 1 deletion src/ucs/arch/ppc64/timebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

double ucs_arch_get_clocks_per_sec()
{
#if HAVE_DECL___PPC_GET_TIMEBASE_FREQ
#if HAVE_DECL___PPC_GET_TIMEBASE_FREQ && defined(HAVE___PPC_GET_TIMEBASE_FREQ)
return __ppc_get_timebase_freq();
#else
return ucs_get_cpuinfo_clock_freq("timebase", 1.0);
Expand Down

0 comments on commit 45d5367

Please sign in to comment.