summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/timespec.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/include/rtems/timespec.h')
-rw-r--r--cpukit/include/rtems/timespec.h53
1 files changed, 36 insertions, 17 deletions
diff --git a/cpukit/include/rtems/timespec.h b/cpukit/include/rtems/timespec.h
index 1e9eea71c5..8d49a8e6c2 100644
--- a/cpukit/include/rtems/timespec.h
+++ b/cpukit/include/rtems/timespec.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -10,9 +12,26 @@
* Copyright (c) 2012.
* Krzysztof Miesowicz <krzysztof.miesowicz@gmail.com>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TIMESPEC_H
@@ -45,7 +64,7 @@ extern "C" {
* @retval true The timespec is valid.
* @retval false The timespec is not valid.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_is_valid(
+static inline bool rtems_timespec_is_valid(
const struct timespec *time
)
{
@@ -64,7 +83,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_is_valid(
* @retval false @a lhs is not less than @a rhs.
*
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_less_than(
+static inline bool rtems_timespec_less_than(
const struct timespec *lhs,
const struct timespec *rhs
)
@@ -83,7 +102,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_less_than(
*
* @return This method returns the number of seconds @a time increased by.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_add_to(
+static inline uint32_t rtems_timespec_add_to(
struct timespec *time,
const struct timespec *add
)
@@ -101,7 +120,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_add_to(
*
* @return This method returns the number of ticks computed.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_to_ticks(
+static inline uint32_t rtems_timespec_to_ticks(
const struct timespec *time
)
{
@@ -118,7 +137,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_to_ticks(
* @param[in] ticks is the number of ticks to convert
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_from_ticks(
+static inline void rtems_timespec_from_ticks(
uint32_t ticks,
struct timespec *time
)
@@ -138,7 +157,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_from_ticks(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_subtract(
+static inline void rtems_timespec_subtract(
const struct timespec *start,
const struct timespec *end,
struct timespec *result
@@ -160,7 +179,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_subtract(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_divide_by_integer(
+static inline void rtems_timespec_divide_by_integer(
const struct timespec *time,
uint32_t iterations,
struct timespec *result
@@ -182,7 +201,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_divide_by_integer(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_divide(
+static inline void rtems_timespec_divide(
const struct timespec *lhs,
const struct timespec *rhs,
uint32_t *ival_percentage,
@@ -202,7 +221,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_divide(
* @param[in] _seconds is the seconds portion of the timespec
* @param[in] _nanoseconds is the nanoseconds portion of the timespec
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_set(
+static inline void rtems_timespec_set(
struct timespec *_time,
time_t _seconds,
uint32_t _nanoseconds
@@ -219,7 +238,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_set(
*
* @param[in] _time points to the timespec instance to zero.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_zero(
+static inline void rtems_timespec_zero(
struct timespec *_time
)
{
@@ -235,7 +254,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_zero(
*
* @return The seconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE time_t rtems_timespec_get_seconds(
+static inline time_t rtems_timespec_get_seconds(
struct timespec *_time
)
{
@@ -251,7 +270,7 @@ RTEMS_INLINE_ROUTINE time_t rtems_timespec_get_seconds(
*
* @return The nanoseconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_get_nanoseconds(
+static inline uint32_t rtems_timespec_get_nanoseconds(
struct timespec *_time
)
{
@@ -269,7 +288,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_get_nanoseconds(
* @retval true @a _lhs is greater than @a _rhs.
* @retval false @a _lhs is not greater than @a _rhs.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_greater_than(
+static inline bool rtems_timespec_greater_than(
const struct timespec *_lhs,
const struct timespec *_rhs
)
@@ -287,7 +306,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_greater_than(
* @retval true @a lhs is equal to @a rhs.
* @retval false @a lhs is not equal to @a rhs.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_equal_to(
+static inline bool rtems_timespec_equal_to(
const struct timespec *lhs,
const struct timespec *rhs
)