RTEMS
Files | Typedefs | Functions
Score Timestamp

Score Timestamp. More...

Files

file  timestamp.h
 Helpers for Manipulating Timestamps.
 
file  timestampimpl.h
 Helpers for Manipulating Timestamps.
 

Typedefs

typedef int64_t Timestamp_Control
 

Functions

static __inline__ void _Timestamp_Set (Timestamp_Control *_time, time_t _seconds, long _nanoseconds)
 Sets timestamp to specified seconds and nanoseconds. More...
 
static __inline__ void _Timestamp_Set_to_zero (Timestamp_Control *_time)
 Sets the timestamp to zero. More...
 
static __inline__ bool _Timestamp_Less_than (const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
 Checks if the left hand side timestamp is less than the right one. More...
 
static __inline__ bool _Timestamp_Greater_than (const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
 Checks if the left hand side timestamp is greater than the right one. More...
 
static __inline__ bool _Timestamp_Equal_to (const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
 Checks if the timestamps are equal. More...
 
static __inline__ void _Timestamp_Add_to (Timestamp_Control *_time, const Timestamp_Control *_add)
 Adds two timestamps. More...
 
static __inline__ void _Timestamp_Subtract (const Timestamp_Control *_start, const Timestamp_Control *_end, Timestamp_Control *_result)
 Subtracts two timestamps. More...
 
static __inline__ void _Timestamp_Divide (const Timestamp_Control *_lhs, const Timestamp_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage)
 Divides a timestamp by another timestamp. More...
 
static __inline__ time_t _Timestamp_Get_seconds (const Timestamp_Control *_time)
 Gets seconds portion of timestamp. More...
 
static __inline__ uint32_t _Timestamp_Get_nanoseconds (const Timestamp_Control *_time)
 Gets nanoseconds portion of timestamp. More...
 
static __inline__ uint64_t _Timestamp_Get_as_nanoseconds (const Timestamp_Control *_time)
 Gets the timestamp as nanoseconds. More...
 
static __inline__ void _Timestamp_To_timespec (const Timestamp_Control *_timestamp, struct timespec *_timespec)
 Converts timestamp to struct timespec. More...
 
static __inline__ void _Timestamp_To_timeval (const Timestamp_Control *_timestamp, struct timeval *_timeval)
 Converts timestamp to struct timeval. More...
 

Detailed Description

Score Timestamp.

This handler encapsulates functionality related to manipulating SuperCore Timestamps. SuperCore Timestamps may be used to represent time of day, uptime, or intervals.

The key attribute of the SuperCore Timestamp handler is that it is a completely opaque handler. There can be multiple implementations of the required functionality and with a recompile, RTEMS can use any implementation. It is intended to be a simple wrapper.

This handler can be implemented as either struct timespec or unsigned64 bit numbers. The use of a wrapper class allows the the implementation of timestamps to change on a per architecture basis. This is an important option as the performance of this handler is critical.

Typedef Documentation

◆ Timestamp_Control

typedef int64_t Timestamp_Control

Define the Timestamp control type.

Definition at line 57 of file timestamp.h.

Function Documentation

◆ _Timestamp_Add_to()

static __inline__ void _Timestamp_Add_to ( Timestamp_Control _time,
const Timestamp_Control _add 
)
static

Adds two timestamps.

This routine adds two timestamps. The second argument is added to the first.

Parameters
[in,out]_timeThe base time to be added to.
_addpoints The timestamp to add to the first argument.

Definition at line 147 of file timestampimpl.h.

◆ _Timestamp_Divide()

static __inline__ void _Timestamp_Divide ( const Timestamp_Control _lhs,
const Timestamp_Control _rhs,
uint32_t *  _ival_percentage,
uint32_t *  _fval_percentage 
)
static

Divides a timestamp by another timestamp.

This routine divides a timestamp by another timestamp. The intended use is for calculating percentages to three decimal points.

Parameters
_lhsThe left hand number.
_rhsThe right hand number.
[out]_ival_percentageThe integer portion of the average.
[out]_fval_percentageThe thousandths of percentage.

Definition at line 186 of file timestampimpl.h.

◆ _Timestamp_Equal_to()

static __inline__ bool _Timestamp_Equal_to ( const Timestamp_Control _lhs,
const Timestamp_Control _rhs 
)
static

Checks if the timestamps are equal.

This method is the is equal to than operator for timestamps.

Parameters
_lhsThe left hand side timestamp.
_rhsThe right hand side timestamp.
Return values
true_lhs is equal to _rhs
false_lhs is not equal to _rhs.

Definition at line 130 of file timestampimpl.h.

◆ _Timestamp_Get_as_nanoseconds()

static __inline__ uint64_t _Timestamp_Get_as_nanoseconds ( const Timestamp_Control _time)
static

Gets the timestamp as nanoseconds.

This method returns the timestamp as nanoseconds.

Parameters
_timeThe timestamp.
Returns
The time in nanoseconds.

Definition at line 252 of file timestampimpl.h.

◆ _Timestamp_Get_nanoseconds()

static __inline__ uint32_t _Timestamp_Get_nanoseconds ( const Timestamp_Control _time)
static

Gets nanoseconds portion of timestamp.

This method returns the nanoseconds portion of the specified timestamp.

Parameters
_timeThe timestamp.
Returns
The nanoseconds portion of _time.

Definition at line 232 of file timestampimpl.h.

◆ _Timestamp_Get_seconds()

static __inline__ time_t _Timestamp_Get_seconds ( const Timestamp_Control _time)
static

Gets seconds portion of timestamp.

This method returns the seconds portion of the specified timestamp.

Parameters
_timeThe timestamp.
Returns
The seconds portion of _time.

Definition at line 216 of file timestampimpl.h.

◆ _Timestamp_Greater_than()

static __inline__ bool _Timestamp_Greater_than ( const Timestamp_Control _lhs,
const Timestamp_Control _rhs 
)
static

Checks if the left hand side timestamp is greater than the right one.

This method is the greater than operator for timestamps.

Parameters
_lhsThe left hand side timestamp.
_rhsThe right hand side timestamp.
Return values
true_lhs is greater than the _rhs.
false_lhs is less or equal than _rhs.

Definition at line 110 of file timestampimpl.h.

◆ _Timestamp_Less_than()

static __inline__ bool _Timestamp_Less_than ( const Timestamp_Control _lhs,
const Timestamp_Control _rhs 
)
static

Checks if the left hand side timestamp is less than the right one.

This method is the less than operator for timestamps.

Parameters
_lhsThe left hand side timestamp.
_rhsThe right hand side timestamp.
Return values
true_lhs is less than the _rhs.
false_lhs is greater or equal than rhs.

Definition at line 90 of file timestampimpl.h.

◆ _Timestamp_Set()

static __inline__ void _Timestamp_Set ( Timestamp_Control _time,
time_t  _seconds,
long  _nanoseconds 
)
static

Sets timestamp to specified seconds and nanoseconds.

This method sets the timestamp to the specified _seconds and _nanoseconds value.

Parameters
[out]_timeThe timestamp instance to set.
_secondsThe seconds portion of the timestamp.
_nanosecondsThe nanoseconds portion of the timestamp.

Definition at line 48 of file timestampimpl.h.

◆ _Timestamp_Set_to_zero()

static __inline__ void _Timestamp_Set_to_zero ( Timestamp_Control _time)
static

Sets the timestamp to zero.

This method sets the timestamp to zero. value.

Parameters
[out]_timeThe timestamp instance to zero.

Definition at line 71 of file timestampimpl.h.

◆ _Timestamp_Subtract()

static __inline__ void _Timestamp_Subtract ( const Timestamp_Control _start,
const Timestamp_Control _end,
Timestamp_Control _result 
)
static

Subtracts two timestamps.

This routine subtracts two timestamps. result is set to end - start.

Parameters
_startThe starting time.
_endThe ending time.
[out]_resultContains the difference between starting and ending time after the method call.

Definition at line 166 of file timestampimpl.h.

◆ _Timestamp_To_timespec()

static __inline__ void _Timestamp_To_timespec ( const Timestamp_Control _timestamp,
struct timespec *  _timespec 
)
static

Converts timestamp to struct timespec.

Parameters
_timestampThe timestamp.
[out]_timespecThe timespec to be filled in by the method.

Definition at line 269 of file timestampimpl.h.

◆ _Timestamp_To_timeval()

static __inline__ void _Timestamp_To_timeval ( const Timestamp_Control _timestamp,
struct timeval *  _timeval 
)
static

Converts timestamp to struct timeval.

Parameters
_timestampThe timestamp.
[out]_timevalThe timeval to be filled in by the method.

Definition at line 283 of file timestampimpl.h.