RTEMS CPU Kit with SuperCore
4.11.3
|
![]() |
Files | |
file | timecounter.h |
Timecounter API. | |
file | timecounterimpl.h |
Timecounter Implementation. | |
Macros | |
#define | _Timecounter_Acquire(lock_context) _ISR_lock_ISR_disable_and_acquire( &_Timecounter_Lock, lock_context ) |
Lock to protect the timecounter mechanic. More... | |
Functions | |
void | _Timecounter_Bintime (struct bintime *bt) |
Returns the wall clock time in the bintime format. More... | |
void | _Timecounter_Nanotime (struct timespec *ts) |
Returns the wall clock time in the timespec format. More... | |
void | _Timecounter_Microtime (struct timeval *tv) |
Returns the wall clock time in the timeval format. More... | |
void | _Timecounter_Binuptime (struct bintime *bt) |
Returns the uptime in the bintime format. More... | |
void | _Timecounter_Nanouptime (struct timespec *ts) |
Returns the uptime in the timespec format. More... | |
void | _Timecounter_Microuptime (struct timeval *tv) |
Returns the uptime in the timeval format. More... | |
void | _Timecounter_Getbintime (struct bintime *bt) |
Returns the wall clock time in the bintime format. More... | |
void | _Timecounter_Getnanotime (struct timespec *ts) |
Returns the wall clock time in the timespec format. More... | |
void | _Timecounter_Getmicrotime (struct timeval *tv) |
Returns the wall clock time in the timeval format. More... | |
void | _Timecounter_Getbinuptime (struct bintime *bt) |
Returns the uptime in the bintime format. More... | |
void | _Timecounter_Getnanouptime (struct timespec *ts) |
Returns the uptime in the timespec format. More... | |
void | _Timecounter_Getmicrouptime (struct timeval *tv) |
Returns the uptime in the timeval format. More... | |
void | _Timecounter_Install (struct timecounter *tc) |
Installs the timecounter. More... | |
void | _Timecounter_Tick (void) |
Performs a timecounter tick. | |
void | _Timecounter_Tick_simple (uint32_t delta, uint32_t offset, ISR_lock_Context *lock_context) |
Performs a simple timecounter tick. More... | |
void | _Timecounter_Initialize (void) |
void | _Timecounter_Set_clock (const struct timespec *ts) |
Variables | |
volatile time_t | _Timecounter_Time_second |
The wall clock time in seconds. | |
volatile time_t | _Timecounter_Time_uptime |
The uptime in seconds. More... | |
struct timecounter * | _Timecounter |
The current timecounter. | |
#define _Timecounter_Acquire | ( | lock_context | ) | _ISR_lock_ISR_disable_and_acquire( &_Timecounter_Lock, lock_context ) |
Lock to protect the timecounter mechanic.
Acquires the timecounter lock.
[in] | lock_context | The lock context. |
See _Timecounter_Tick_simple().
Referenced by rtems_clock_tick(), rtems_timecounter_simple_downcounter_tick(), and rtems_timecounter_simple_upcounter_tick().
void _Timecounter_Bintime | ( | struct bintime * | bt | ) |
Returns the wall clock time in the bintime format.
[out] | bt | Returns the wall clock time. |
void _Timecounter_Binuptime | ( | struct bintime * | bt | ) |
Returns the uptime in the bintime format.
[out] | bt | Returns the uptime. |
void _Timecounter_Getbintime | ( | struct bintime * | bt | ) |
Returns the wall clock time in the bintime format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Bintime() variant.
[out] | ts | Returns the wall clock time. |
void _Timecounter_Getbinuptime | ( | struct bintime * | bt | ) |
Returns the uptime in the bintime format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Binuptime() variant.
[out] | ts | Returns the uptime. |
void _Timecounter_Getmicrotime | ( | struct timeval * | tv | ) |
Returns the wall clock time in the timeval format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Microtime() variant.
[out] | tv | Returns the wall clock time. |
Referenced by rtems_bsd_getmicrotime().
void _Timecounter_Getmicrouptime | ( | struct timeval * | tv | ) |
Returns the uptime in the timeval format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Microuptime() variant.
[out] | tv | Returns the uptime. |
Referenced by rtems_bsd_getmicrouptime().
void _Timecounter_Getnanotime | ( | struct timespec * | ts | ) |
Returns the wall clock time in the timespec format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Nanotime() variant.
[out] | ts | Returns the wall clock time. |
Referenced by rtems_bsd_getnanotime().
void _Timecounter_Getnanouptime | ( | struct timespec * | ts | ) |
Returns the uptime in the timespec format.
This function obtains the time with a lower overhead and lower accuracy compared to the _Timecounter_Nanouptime() variant.
[out] | ts | Returns the uptime. |
Referenced by rtems_bsd_getnanouptime().
void _Timecounter_Install | ( | struct timecounter * | tc | ) |
Installs the timecounter.
The timecounter structure must contain valid values in the fields tc_get_timecount, tc_counter_mask, tc_frequency and tc_quality. All other fields must be zero initialized.
[in] | tc | The timecounter. |
Referenced by rtems_timecounter_install().
void _Timecounter_Microtime | ( | struct timeval * | tv | ) |
Returns the wall clock time in the timeval format.
[out] | tv | Returns the wall clock time. |
Referenced by _TOD_Get_timeval(), and rtems_bsd_microtime().
void _Timecounter_Microuptime | ( | struct timeval * | tv | ) |
Returns the uptime in the timeval format.
[out] | tv | Returns the uptime. |
Referenced by rtems_bsd_microuptime().
void _Timecounter_Nanotime | ( | struct timespec * | ts | ) |
Returns the wall clock time in the timespec format.
[out] | ts | Returns the wall clock time. |
Referenced by rtems_bsd_nanotime().
void _Timecounter_Nanouptime | ( | struct timespec * | ts | ) |
Returns the uptime in the timespec format.
[out] | ts | Returns the uptime. |
Referenced by rtems_bsd_nanouptime().
void _Timecounter_Tick_simple | ( | uint32_t | delta, |
uint32_t | offset, | ||
ISR_lock_Context * | lock_context | ||
) |
Performs a simple timecounter tick.
This is a special purpose tick function for simple timecounter to support legacy clock drivers.
[in] | delta | The time in timecounter ticks elapsed since the last call to _Timecounter_Tick_simple(). |
[in] | offset | The current value of the timecounter. |
[in] | lock_context | The lock context of the corresponding _Timecounter_Acquire(). |
Referenced by rtems_clock_tick(), rtems_timecounter_simple_downcounter_tick(), and rtems_timecounter_simple_upcounter_tick().
volatile time_t _Timecounter_Time_uptime |
The uptime in seconds.
For compatibility with the FreeBSD network stack the initial value is one second.
Referenced by rtems_clock_get_uptime_seconds().