summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-20 07:29:22 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-24 09:37:28 +0200
commit57479629094a7b1a13a6fb03c3162cb53367022c (patch)
tree05f1fa971f6b5391cd91c36d33cddcbc9aad588f /cpukit/score/include/rtems
parentscore: Add _Watchdog_Monotonic_from_timespec() (diff)
downloadrtems-57479629094a7b1a13a6fb03c3162cb53367022c.tar.bz2
score: _Watchdog_Per_CPU_lazy_insert_monotonic()
Update #3117. Update #3182.
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r--cpukit/score/include/rtems/score/watchdogimpl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h
index b3f396b7a3..1fa67f3961 100644
--- a/cpukit/score/include/rtems/score/watchdogimpl.h
+++ b/cpukit/score/include/rtems/score/watchdogimpl.h
@@ -425,6 +425,31 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks(
return expire;
}
+RTEMS_INLINE_ROUTINE bool _Watchdog_Per_CPU_lazy_insert_monotonic(
+ Watchdog_Control *the_watchdog,
+ Per_CPU_Control *cpu,
+ uint64_t expire
+)
+{
+ ISR_lock_Context lock_context;
+ Watchdog_Header *header;
+ bool insert;
+
+ header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
+
+ _Watchdog_Set_CPU( the_watchdog, cpu );
+
+ _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context );
+ insert = ( expire > cpu->Watchdog.ticks );
+
+ if ( insert ) {
+ _Watchdog_Insert(header, the_watchdog, expire);
+ }
+
+ _Watchdog_Per_CPU_release_critical( cpu, &lock_context );
+ return insert;
+}
+
RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_realtime(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu,