37#ifndef _RTEMS_SCORE_TIMESPEC_H
38#define _RTEMS_SCORE_TIMESPEC_H
69#define _Timespec_Set( _time, _seconds, _nanoseconds ) \
71 (_time)->tv_sec = (_seconds); \
72 (_time)->tv_nsec = (_nanoseconds); \
83#define _Timespec_Set_to_zero( _time ) \
85 (_time)->tv_sec = 0; \
86 (_time)->tv_nsec = 0; \
98#define _Timespec_Get_seconds( _time ) \
110#define _Timespec_Get_nanoseconds( _time ) \
123 const struct timespec *time
135 const struct timespec *time
149 const struct timespec *time
164 const struct timespec *lhs,
165 const struct timespec *rhs
179#define _Timespec_Greater_than( _lhs, _rhs ) \
180 _Timespec_Less_than( _rhs, _lhs )
193#define _Timespec_Equal_to( lhs, rhs ) \
194 ( ((lhs)->tv_sec == (rhs)->tv_sec) && \
195 ((lhs)->tv_nsec == (rhs)->tv_nsec) \
210 struct timespec *time,
211 const struct timespec *add
225 const struct timespec *time
239 struct timespec *time
253 const struct timespec *start,
254 const struct timespec *end,
255 struct timespec *result
270 const struct timespec *time,
272 struct timespec *result
287 const struct timespec *lhs,
288 const struct timespec *rhs,
289 uint32_t *ival_percentage,
290 uint32_t *fval_percentage
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
bool _Timespec_Less_than(const struct timespec *lhs, const struct timespec *rhs)
Checks if the left hand side timespec is less than the right one.
Definition: timespeclessthan.c:46
uint32_t _Timespec_To_ticks(const struct timespec *time)
Converts timespec to number of ticks.
Definition: timespectoticks.c:51
uint64_t _Timespec_Get_as_nanoseconds(const struct timespec *time)
Gets the timestamp as nanoseconds.
Definition: timespecgetasnanoseconds.c:44
void _Timespec_From_ticks(uint32_t ticks, struct timespec *time)
Converts ticks to timespec.
Definition: timespecfromticks.c:46
bool _Timespec_Is_non_negative(const struct timespec *time)
Checks if the values in time are non-negative.
Definition: timespecisnonnegative.c:43
bool _Timespec_Is_valid(const struct timespec *time)
Checks if timespec is valid.
Definition: timespecisvalid.c:45
void _Timespec_Subtract(const struct timespec *start, const struct timespec *end, struct timespec *result)
Subtracts two timespec.
Definition: timespecsubtract.c:45
time_t _Timespec_Add_to(struct timespec *time, const struct timespec *add)
Adds two timespecs.
Definition: timespecaddto.c:46
void _Timespec_Divide_by_integer(const struct timespec *time, uint32_t iterations, struct timespec *result)
Divides timespec by an integer.
Definition: timespecdividebyinteger.c:45