20 #ifndef _RTEMS_SCORE_TIMESTAMPIMPL_H 21 #define _RTEMS_SCORE_TIMESTAMPIMPL_H 56 _ts.tv_sec = _seconds;
57 _ts.tv_nsec = _nanoseconds;
59 *_time = tstosbt(_ts);
115 return *_lhs > *_rhs;
135 return *_lhs == *_rhs;
172 *_result = *_end - *
_start;
189 uint32_t *_ival_percentage,
190 uint32_t *_fval_percentage
193 struct timespec _ts_left;
194 struct timespec _ts_right;
196 _ts_left = sbttots( *_lhs );
197 _ts_right = sbttots( *_rhs );
220 return (*_time >> 32);
238 _ts = sbttots( *_time );
240 return (uint32_t) _ts.tv_nsec;
258 _ts = sbttots( *_time );
271 struct timespec *_timespec
274 *_timespec = sbttots( *_timestamp );
285 struct timeval *_timeval
288 *_timeval = sbttotv( *_timestamp );
int64_t Timestamp_Control
Definition: timestamp.h:57
void _start(void)
System start entry.
RTEMS_INLINE_ROUTINE void _Timestamp_To_timeval(const Timestamp_Control *_timestamp, struct timeval *_timeval)
Converts timestamp to struct timeval.
Definition: timestampimpl.h:283
RTEMS_INLINE_ROUTINE bool _Timestamp_Equal_to(const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
Checks if the timestamps are equal.
Definition: timestampimpl.h:130
Helpers for Manipulating Timestamps.
RTEMS_INLINE_ROUTINE uint32_t _Timestamp_Get_nanoseconds(const Timestamp_Control *_time)
Gets nanoseconds portion of timestamp.
Definition: timestampimpl.h:232
RTEMS_INLINE_ROUTINE void _Timestamp_Add_to(Timestamp_Control *_time, const Timestamp_Control *_add)
Adds two timestamps.
Definition: timestampimpl.h:147
RTEMS_INLINE_ROUTINE 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.
Definition: timestampimpl.h:110
void _Timespec_Divide(const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage)
Divides a timespec by another timespec.
Definition: timespecdivide.c:25
RTEMS_INLINE_ROUTINE void _Timestamp_Subtract(const Timestamp_Control *_start, const Timestamp_Control *_end, Timestamp_Control *_result)
Subtracts two timestamps.
Definition: timestampimpl.h:166
RTEMS_INLINE_ROUTINE time_t _Timestamp_Get_seconds(const Timestamp_Control *_time)
Gets seconds portion of timestamp.
Definition: timestampimpl.h:216
RTEMS_INLINE_ROUTINE uint64_t _Timestamp_Get_as_nanoseconds(const Timestamp_Control *_time)
Gets the timestamp as nanoseconds.
Definition: timestampimpl.h:252
RTEMS_INLINE_ROUTINE void _Timestamp_Set(Timestamp_Control *_time, time_t _seconds, long _nanoseconds)
Sets timestamp to specified seconds and nanoseconds.
Definition: timestampimpl.h:48
RTEMS_INLINE_ROUTINE 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.
Definition: timestampimpl.h:186
RTEMS_INLINE_ROUTINE void _Timestamp_Set_to_zero(Timestamp_Control *_time)
Sets the timestamp to zero.
Definition: timestampimpl.h:71
RTEMS_INLINE_ROUTINE 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.
Definition: timestampimpl.h:90
uint64_t _Timespec_Get_as_nanoseconds(const struct timespec *time)
Gets the timestamp as nanoseconds.
Definition: timespecgetasnanoseconds.c:23
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE void _Timestamp_To_timespec(const Timestamp_Control *_timestamp, struct timespec *_timespec)
Converts timestamp to struct timespec.
Definition: timestampimpl.h:269