diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-12 16:14:28 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-15 09:48:35 +0100 |
commit | cc9f28a631cd3428fff21142f2929e6d5c8d869a (patch) | |
tree | a0b9cba979b41696bb847bc8de4014071649e6c2 | |
parent | 654e0b02f56b52dab32b263e09b9d8d53d2c61c8 (diff) |
score: Add _Watchdog_Per_CPU_reinsert_ticks()
-rw-r--r-- | cpukit/include/rtems/score/watchdogimpl.h | 21 | ||||
-rw-r--r-- | cpukit/posix/src/ualarm.c | 2 | ||||
-rw-r--r-- | cpukit/rtems/src/ratemontimeout.c | 7 |
3 files changed, 25 insertions, 5 deletions
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h index 14a92cd42a..82963e3eab 100644 --- a/cpukit/include/rtems/score/watchdogimpl.h +++ b/cpukit/include/rtems/score/watchdogimpl.h @@ -429,7 +429,26 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks( _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context ); expire = ticks + cpu->Watchdog.ticks; - _Watchdog_Insert(header, the_watchdog, expire); + _Watchdog_Insert( header, the_watchdog, expire ); + _Watchdog_Per_CPU_release_critical( cpu, &lock_context ); + return expire; +} + +RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_reinsert_ticks( + Watchdog_Control *the_watchdog, + Per_CPU_Control *cpu, + Watchdog_Interval ticks +) +{ + ISR_lock_Context lock_context; + Watchdog_Header *header; + uint64_t expire; + + header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ]; + + _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context ); + expire = ticks + cpu->Watchdog.ticks; + _Watchdog_Insert( header, the_watchdog, expire ); _Watchdog_Per_CPU_release_critical( cpu, &lock_context ); return expire; } diff --git a/cpukit/posix/src/ualarm.c b/cpukit/posix/src/ualarm.c index 972e9d3880..71af4b112f 100644 --- a/cpukit/posix/src/ualarm.c +++ b/cpukit/posix/src/ualarm.c @@ -58,7 +58,7 @@ static void _POSIX_signals_Ualarm_TSR( * If the reset interval is non-zero, reschedule ourselves. */ if ( _POSIX_signals_Ualarm_interval != 0 ) { - _Watchdog_Per_CPU_insert_ticks( + _Watchdog_Per_CPU_reinsert_ticks( the_watchdog, cpu, _POSIX_signals_Ualarm_interval diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c index 07549c4492..42239f3f2c 100644 --- a/cpukit/rtems/src/ratemontimeout.c +++ b/cpukit/rtems/src/ratemontimeout.c @@ -24,6 +24,7 @@ static void _Rate_monotonic_Renew_deadline( Rate_monotonic_Control *the_period, + Per_CPU_Control *cpu, ISR_lock_Context *lock_context ) { @@ -36,9 +37,9 @@ static void _Rate_monotonic_Renew_deadline( the_period->state = RATE_MONOTONIC_EXPIRED; - deadline = _Watchdog_Per_CPU_insert_ticks( + deadline = _Watchdog_Per_CPU_reinsert_ticks( &the_period->Timer, - _Per_CPU_Get(), + cpu, the_period->next_length ); the_period->latest_deadline = deadline; @@ -91,6 +92,6 @@ void _Rate_monotonic_Timeout( _Thread_Unblock( owner ); } } else { - _Rate_monotonic_Renew_deadline( the_period, &lock_context ); + _Rate_monotonic_Renew_deadline( the_period, cpu, &lock_context ); } } |