From bf2a53d272107b8b224b1a48694da24d2d042442 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 14 Oct 2017 15:14:53 +0200 Subject: score: Rename watchdog variants Rename PER_CPU_WATCHDOG_RELATIVE in PER_CPU_WATCHDOG_MONOTONIC to highlight the corresponding POSIX CLOCK_MONOTONIC. Rename PER_CPU_WATCHDOG_ABSOLUTE in PER_CPU_WATCHDOG_REALTIME to highlight the corresponding POSIX CLOCK_REALTIME. Update #3117. Update #3182. --- cpukit/score/include/rtems/score/percpu.h | 22 +++++++++++++--------- cpukit/score/include/rtems/score/threadimpl.h | 14 +++++++------- cpukit/score/include/rtems/score/watchdogimpl.h | 20 ++++++++++---------- 3 files changed, 30 insertions(+), 26 deletions(-) (limited to 'cpukit/score/include/rtems') diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 97cb2bea15..00528b5ce3 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -248,20 +248,23 @@ typedef struct { */ typedef enum { /** - * @brief Index for relative per-CPU watchdog header. + * @brief Index for monotonic clock per-CPU watchdog header. * - * The reference time point for this header is current ticks value - * during insert. Time is measured in clock ticks. + * The reference time point for the monotonic clock is the system start. The + * clock resolution is one system clock tick. It is used for the system + * clock tick based time services and the POSIX services using + * CLOCK_MONOTONIC. */ - PER_CPU_WATCHDOG_RELATIVE, + PER_CPU_WATCHDOG_MONOTONIC, /** - * @brief Index for absolute per-CPU watchdog header. + * @brief Index for realtime clock per-CPU watchdog header. * - * The reference time point for this header is the POSIX Epoch. Time is - * measured in nanoseconds since POSIX Epoch. + * The reference time point for the realtime clock is the POSIX Epoch. The + * clock resolution is one nanosecond. It is used for the time of day + * services and the POSIX services using CLOCK_REALTIME. */ - PER_CPU_WATCHDOG_ABSOLUTE, + PER_CPU_WATCHDOG_REALTIME, /** * @brief Count of per-CPU watchdog headers. @@ -395,7 +398,8 @@ typedef struct Per_CPU_Control { ISR_LOCK_MEMBER( Lock ) /** - * @brief Watchdog ticks on this processor used for relative watchdogs. + * @brief Watchdog ticks on this processor used for monotonic clock + * watchdogs. */ uint64_t ticks; diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 60c7759e09..67de07e5a2 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -1853,11 +1853,11 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_initialize( ) { _ISR_lock_Initialize( &timer->Lock, "Thread Timer" ); - timer->header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_RELATIVE ]; + timer->header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ]; _Watchdog_Preinitialize( &timer->Watchdog, cpu ); } -RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_relative( +RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_monotonic( Thread_Control *the_thread, Per_CPU_Control *cpu, Watchdog_Service_routine_entry routine, @@ -1869,14 +1869,14 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_relative( _ISR_lock_ISR_disable_and_acquire( &the_thread->Timer.Lock, &lock_context ); the_thread->Timer.header = - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_RELATIVE ]; + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ]; the_thread->Timer.Watchdog.routine = routine; - _Watchdog_Per_CPU_insert_relative( &the_thread->Timer.Watchdog, cpu, ticks ); + _Watchdog_Per_CPU_insert_monotonic( &the_thread->Timer.Watchdog, cpu, ticks ); _ISR_lock_Release_and_ISR_enable( &the_thread->Timer.Lock, &lock_context ); } -RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_absolute( +RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_realtime( Thread_Control *the_thread, Per_CPU_Control *cpu, Watchdog_Service_routine_entry routine, @@ -1888,9 +1888,9 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_absolute( _ISR_lock_ISR_disable_and_acquire( &the_thread->Timer.Lock, &lock_context ); the_thread->Timer.header = - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_ABSOLUTE ]; + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ]; the_thread->Timer.Watchdog.routine = routine; - _Watchdog_Per_CPU_insert_absolute( &the_thread->Timer.Watchdog, cpu, expire ); + _Watchdog_Per_CPU_insert_realtime( &the_thread->Timer.Watchdog, cpu, expire ); _ISR_lock_Release_and_ISR_enable( &the_thread->Timer.Lock, &lock_context ); } diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index f6ad05cd8a..e248bcc061 100644 --- a/cpukit/score/include/rtems/score/watchdogimpl.h +++ b/cpukit/score/include/rtems/score/watchdogimpl.h @@ -351,7 +351,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_release_critical( _ISR_lock_Release( &cpu->Watchdog.Lock, lock_context ); } -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_relative( +RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_monotonic( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, Watchdog_Interval ticks @@ -361,7 +361,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_relative( Watchdog_Header *header; uint64_t expire; - header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_RELATIVE ]; + header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ]; _Watchdog_Set_CPU( the_watchdog, cpu ); @@ -372,7 +372,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_relative( return expire; } -RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_absolute( +RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_realtime( Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, uint64_t expire @@ -381,7 +381,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_absolute( ISR_lock_Context lock_context; Watchdog_Header *header; - header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_ABSOLUTE ]; + header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ]; _Watchdog_Set_CPU( the_watchdog, cpu ); @@ -407,7 +407,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove( _Watchdog_Per_CPU_release_critical( cpu, &lock_context ); } -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_relative( +RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_monotonic( Watchdog_Control *the_watchdog ) { @@ -417,11 +417,11 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_relative( _Watchdog_Per_CPU_remove( the_watchdog, cpu, - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_RELATIVE ] + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ] ); } -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_absolute( +RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_realtime( Watchdog_Control *the_watchdog ) { @@ -431,11 +431,11 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_absolute( _Watchdog_Per_CPU_remove( the_watchdog, cpu, - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_ABSOLUTE ] + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ] ); } -RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_tickle_absolute( +RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_tickle_realtime( Per_CPU_Control *cpu, uint64_t now ) @@ -444,7 +444,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_tickle_absolute( _ISR_lock_ISR_disable_and_acquire( &cpu->Watchdog.Lock, &lock_context ); _Watchdog_Tickle( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_ABSOLUTE ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ], now, &cpu->Watchdog.Lock, &lock_context -- cgit v1.2.3