23 #ifndef _RTEMS_TIMECOUNTER_H 24 #define _RTEMS_TIMECOUNTER_H 47 #define RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER 100 94 uint32_t real_interval;
95 uint32_t binary_interval;
193 uint32_t counter_frequency_in_hz,
194 uint32_t counter_ticks_per_clock_tick,
195 timecounter_get_t *get_timecount
211 return (uint32_t) ( ( value * tc->scaler ) >> 32 );
237 tc->real_interval - ( *get )( tc )
289 counter = ( *get )( tc );
290 interval = tc->real_interval;
292 if ( ( *is_pending )( tc ) ) {
293 counter = ( *get )( tc );
320 counter = ( *get )( tc );
323 if ( ( *is_pending )( tc ) ) {
324 counter = ( *get )( tc );
325 interval = tc->real_interval;
RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_upcounter_get(struct timecounter *tc_base, rtems_timecounter_simple_get get, rtems_timecounter_simple_is_pending is_pending)
Gets the simple timecounter value mapped to its binary frequency domain for upcounters.
Definition: timecounter.h:309
void _Timecounter_Tick_simple(uint32_t delta, uint32_t offset, ISR_lock_Context *lock_context)
Performs a simple timecounter tick.
void _Timecounter_Install(struct timecounter *tc)
Installs the timecounter.
RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_scale(const rtems_timecounter_simple *tc, uint32_t value)
Maps a simple timecounter value into its binary frequency domain.
Definition: timecounter.h:206
void rtems_timecounter_simple_at_tick(rtems_timecounter_simple *tc)
At tick handling done under protection of the timecounter lock.
Definition: timecounter.h:101
#define _Timecounter_Acquire(lock_context)
Lock to protect the timecounter mechanic.
Definition: timecounter.h:201
RTEMS_INLINE_ROUTINE void rtems_timecounter_tick(void)
Performs a timecounter tick.
Definition: timecounter.h:83
bool rtems_timecounter_simple_is_pending(rtems_timecounter_simple *tc)
Returns true if the interrupt of a simple timecounter is pending, and false otherwise.
Definition: timecounter.h:116
RTEMS_INLINE_ROUTINE void rtems_timecounter_install(struct timecounter *tc)
Installs the timecounter.
Definition: timecounter.h:73
void _Timecounter_Tick(void)
Performs a timecounter tick.
void rtems_timecounter_simple_install(rtems_timecounter_simple *tc, uint32_t counter_frequency_in_hz, uint32_t counter_ticks_per_clock_tick, timecounter_get_t *get_timecount)
Initializes and installs a simple timecounter.
Definition: tcsimpleinstall.c:21
RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_downcounter_tick(rtems_timecounter_simple *tc, rtems_timecounter_simple_get get, rtems_timecounter_simple_at_tick at_tick)
Performs a simple timecounter tick for downcounters.
Definition: timecounter.h:222
uint32_t rtems_timecounter_simple_get(rtems_timecounter_simple *tc)
Returns the current value of a simple timecounter.
Definition: timecounter.h:108
RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_upcounter_tick(rtems_timecounter_simple *tc, rtems_timecounter_simple_get get, rtems_timecounter_simple_at_tick at_tick)
Performs a simple timecounter tick for upcounters.
Definition: timecounter.h:251
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_downcounter_get(struct timecounter *tc_base, rtems_timecounter_simple_get get, rtems_timecounter_simple_is_pending is_pending)
Gets the simple timecounter value mapped to its binary frequency domain for downcounters.
Definition: timecounter.h:278
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
Simple timecounter to support legacy clock drivers.
Definition: timecounter.h:91