Changeset 34799c3b in rtems


Ignore:
Timestamp:
Oct 24, 2017, 7:35:06 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0ddffb76
Parents:
4c70110
git-author:
Sebastian Huber <sebastian.huber@…> (10/24/17 07:35:06)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/25/17 05:26:37)
Message:

rtems: rtems_clock_get_ticks_per_second()

Add macro implementation for rtems_clock_get_ticks_per_second() for
C/C++ to avoid the function call overhead. A
rtems_clock_get_ticks_per_second() is still provided for language
bindings (e.g. Ada).

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/clock.h

    r4c70110 r34799c3b  
    199199rtems_interval rtems_clock_get_ticks_per_second(void);
    200200
     201/* Optimized variant for C/C++ without function call overhead */
     202#define rtems_clock_get_ticks_per_second() ( _Watchdog_Ticks_per_second )
     203
    201204/**
    202205 * @brief Set the Current TOD
  • cpukit/rtems/src/clockgettickspersecond.c

    r4c70110 r34799c3b  
    2121#include <rtems/rtems/clock.h>
    2222
     23#undef rtems_clock_get_ticks_per_second
     24
    2325rtems_interval rtems_clock_get_ticks_per_second(void)
    2426{
  • testsuites/sptests/spwatchdog/init.c

    r4c70110 r34799c3b  
    6363  rtems_test_assert( _Watchdog_Ticks_per_second == 100 );
    6464  rtems_test_assert( _Watchdog_Monotonic_max_seconds == 184467440737095516 );
     65  rtems_test_assert( rtems_clock_get_ticks_per_second() == 100 );
     66  #undef rtems_clock_get_ticks_per_second
     67  rtems_test_assert( rtems_clock_get_ticks_per_second() == 100 );
    6568}
    6669
Note: See TracChangeset for help on using the changeset viewer.