diff options
Diffstat (limited to 'cpukit/include/rtems/score/watchdogimpl.h')
-rw-r--r-- | cpukit/include/rtems/score/watchdogimpl.h | 77 |
1 files changed, 48 insertions, 29 deletions
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h index ba1a884a3d..df479aeeed 100644 --- a/cpukit/include/rtems/score/watchdogimpl.h +++ b/cpukit/include/rtems/score/watchdogimpl.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-2004. * On-Line Applications Research Corporation (OAR). * - * 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_SCORE_WATCHDOGIMPL_H @@ -95,7 +114,7 @@ typedef enum { * * @param[out] header The header to initialize. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Header_initialize( +static inline void _Watchdog_Header_initialize( Watchdog_Header *header ) { @@ -110,7 +129,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Header_initialize( * * @return The first of @a header. */ -RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Header_first( +static inline Watchdog_Control *_Watchdog_Header_first( const Watchdog_Header *header ) { @@ -122,7 +141,7 @@ RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Header_first( * * @param header The watchdog header to destroy. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Header_destroy( +static inline void _Watchdog_Header_destroy( Watchdog_Header *header ) { @@ -144,7 +163,7 @@ void _Watchdog_Tick( struct Per_CPU_Control *cpu ); * * @return The RB_COLOR of @a the_watchdog. */ -RTEMS_INLINE_ROUTINE Watchdog_State _Watchdog_Get_state( +static inline Watchdog_State _Watchdog_Get_state( const Watchdog_Control *the_watchdog ) { @@ -157,7 +176,7 @@ RTEMS_INLINE_ROUTINE Watchdog_State _Watchdog_Get_state( * @param[out] the_watchdog The watchdog to set the state of. * @param state The state to set the watchdog to. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Set_state( +static inline void _Watchdog_Set_state( Watchdog_Control *the_watchdog, Watchdog_State state ) @@ -172,7 +191,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Set_state( * * @return The cpu of the watchdog. */ -RTEMS_INLINE_ROUTINE Per_CPU_Control *_Watchdog_Get_CPU( +static inline Per_CPU_Control *_Watchdog_Get_CPU( const Watchdog_Control *the_watchdog ) { @@ -189,7 +208,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Watchdog_Get_CPU( * @param[out] the_watchdog The watchdog to set the cpu of. * @param cpu The cpu to be set as @a the_watchdog's cpu. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Set_CPU( +static inline void _Watchdog_Set_CPU( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu ) @@ -209,7 +228,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Set_CPU( * * @param[out] the_watchdog The uninitialized watchdog. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize( +static inline void _Watchdog_Preinitialize( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu ) @@ -231,7 +250,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize( * @param[out] the_watchdog The watchdog to initialize. * @param routing The service routine for @a the_watchdog. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Initialize( +static inline void _Watchdog_Initialize( Watchdog_Control *the_watchdog, Watchdog_Service_routine_entry routine ) @@ -313,7 +332,7 @@ void _Watchdog_Remove( * @retval 0 The now time is greater than or equal to the expiration time of * the watchdog. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Cancel( +static inline uint64_t _Watchdog_Cancel( Watchdog_Header *header, Watchdog_Control *the_watchdog, uint64_t now @@ -343,7 +362,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Cancel( * @retval true The watchdog is scheduled. * @retval false The watchdog is inactive. */ -RTEMS_INLINE_ROUTINE bool _Watchdog_Is_scheduled( +static inline bool _Watchdog_Is_scheduled( const Watchdog_Control *the_watchdog ) { @@ -362,7 +381,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_scheduled( * @param first is the current first watchdog which should be removed * afterwards. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Next_first( +static inline void _Watchdog_Next_first( Watchdog_Header *header, const Watchdog_Control *first ) @@ -431,7 +450,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Next_first( * @retval true The timespec is a valid timespec. * @retval false The timespec is invalid. */ -RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_timespec( +static inline bool _Watchdog_Is_valid_timespec( const struct timespec *ts ) { @@ -447,7 +466,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_timespec( * @retval true The timespec is a valid interval timespec. * @retval false The timespec is invalid. */ -RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_interval_timespec( +static inline bool _Watchdog_Is_valid_interval_timespec( const struct timespec *ts ) { @@ -464,7 +483,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_interval_timespec( * @retval pointer Pointer to the now timespec. * @retval NULL @a delta is not a valid interval timespec. */ -RTEMS_INLINE_ROUTINE const struct timespec * _Watchdog_Future_timespec( +static inline const struct timespec * _Watchdog_Future_timespec( struct timespec *now, const struct timespec *delta ) @@ -502,7 +521,7 @@ RTEMS_INLINE_ROUTINE const struct timespec * _Watchdog_Future_timespec( * @retval true @a ts is too far in the future. * @retval false @a ts is not too far in the future. */ -RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_timespec( +static inline bool _Watchdog_Is_far_future_timespec( const struct timespec *ts ) { @@ -516,7 +535,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_timespec( * * @return @a seconds converted to ticks. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds( +static inline uint64_t _Watchdog_Ticks_from_seconds( uint32_t seconds ) { @@ -534,7 +553,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds( * * @return @a ts converted to ticks. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec( +static inline uint64_t _Watchdog_Ticks_from_timespec( const struct timespec *ts ) { @@ -558,7 +577,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec( * * @param[out] ts is the timespec to return the converted ticks. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Ticks_to_timespec( +static inline void _Watchdog_Ticks_to_timespec( uint64_t ticks, struct timespec *ts ) @@ -574,7 +593,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Ticks_to_timespec( * * @return @a sbt converted to ticks. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt ) +static inline uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt ) { uint64_t ticks = ( sbt >> 32 ) << WATCHDOG_BITS_FOR_1E9_NANOSECONDS; @@ -589,7 +608,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt ) * @param cpu The cpu to acquire the watchdog lock of. * @param lock_context The lock context. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_acquire_critical( +static inline void _Watchdog_Per_CPU_acquire_critical( Per_CPU_Control *cpu, ISR_lock_Context *lock_context ) @@ -603,7 +622,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_acquire_critical( * @param cpu The cpu to release the watchdog lock of. * @param lock_context The lock context. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_release_critical( +static inline void _Watchdog_Per_CPU_release_critical( Per_CPU_Control *cpu, ISR_lock_Context *lock_context ) @@ -621,7 +640,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_release_critical( * * @return The new expiration time of the watchdog. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks( +static inline uint64_t _Watchdog_Per_CPU_insert_ticks( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, Watchdog_Interval ticks @@ -653,7 +672,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks( * * @return The expiration time of the watchdog. */ -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert( +static inline uint64_t _Watchdog_Per_CPU_insert( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, Watchdog_Header *header, @@ -677,7 +696,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert( * @param cpu The cpu to remove the watchdog from. * @param[in, out] The scheduled watchdogs. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove( +static inline void _Watchdog_Per_CPU_remove( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, Watchdog_Header *header @@ -698,7 +717,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove( * * @param[in, out] the_watchdog The watchdog to remove. */ -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_ticks( +static inline void _Watchdog_Per_CPU_remove_ticks( Watchdog_Control *the_watchdog ) { |