38#ifndef _RTEMS_SCORE_TIMESTAMPIMPL_H
39#define _RTEMS_SCORE_TIMESTAMPIMPL_H
66static inline void _Timestamp_Set(
74 _ts.tv_sec = _seconds;
75 _ts.tv_nsec = _nanoseconds;
77 *_time = tstosbt(_ts);
89static inline void _Timestamp_Set_to_zero(
108static inline bool _Timestamp_Less_than(
113 return *_lhs < *_rhs;
128static inline bool _Timestamp_Greater_than(
133 return *_lhs > *_rhs;
148static inline bool _Timestamp_Equal_to(
153 return *_lhs == *_rhs;
165static inline void _Timestamp_Add_to(
184static inline void _Timestamp_Subtract(
190 *_result = *_end - *
_start;
204static inline void _Timestamp_Divide(
207 uint32_t *_ival_percentage,
208 uint32_t *_fval_percentage
211 struct timespec _ts_left;
212 struct timespec _ts_right;
214 _ts_left = sbttots( *_lhs );
215 _ts_right = sbttots( *_rhs );
234static inline time_t _Timestamp_Get_seconds(
238 return (*_time >> 32);
250static inline uint32_t _Timestamp_Get_nanoseconds(
256 _ts = sbttots( *_time );
258 return (uint32_t) _ts.tv_nsec;
270static inline uint64_t _Timestamp_Get_as_nanoseconds(
276 _ts = sbttots( *_time );
287static inline void _Timestamp_To_timespec(
289 struct timespec *_timespec
292 *_timespec = sbttots( *_timestamp );
301static inline void _Timestamp_To_timeval(
303 struct timeval *_timeval
306 *_timeval = sbttotv( *_timestamp );
This header file provides basic definitions used by the API and the implementation.
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:45
uint64_t _Timespec_Get_as_nanoseconds(const struct timespec *time)
Gets the timestamp as nanoseconds.
Definition: timespecgetasnanoseconds.c:44
int64_t Timestamp_Control
Definition: timestamp.h:76
void _start(void)
System start entry.
This header file provides interfaces of the Timestamp Handler which are used by the implementation an...