summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/include/rtems/rtems/clock.h3
-rw-r--r--cpukit/rtems/src/clockgettickspersecond.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/clock.h b/cpukit/rtems/include/rtems/rtems/clock.h
index b1ae8845a6..a837b88700 100644
--- a/cpukit/rtems/include/rtems/rtems/clock.h
+++ b/cpukit/rtems/include/rtems/rtems/clock.h
@@ -198,6 +198,9 @@ RTEMS_INLINE_ROUTINE bool rtems_clock_tick_before(
*/
rtems_interval rtems_clock_get_ticks_per_second(void);
+/* Optimized variant for C/C++ without function call overhead */
+#define rtems_clock_get_ticks_per_second() ( _Watchdog_Ticks_per_second )
+
/**
* @brief Set the Current TOD
*
diff --git a/cpukit/rtems/src/clockgettickspersecond.c b/cpukit/rtems/src/clockgettickspersecond.c
index a2f78eb627..07497cfd58 100644
--- a/cpukit/rtems/src/clockgettickspersecond.c
+++ b/cpukit/rtems/src/clockgettickspersecond.c
@@ -20,6 +20,8 @@
#include <rtems/rtems/clock.h>
+#undef rtems_clock_get_ticks_per_second
+
rtems_interval rtems_clock_get_ticks_per_second(void)
{
return _Watchdog_Ticks_per_second;