summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/watchdogimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-15 16:28:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:42 +0200
commit6d2539413bcc0be45b6fb40e93b4012a1d91b58f (patch)
tree57df90da33bc49a78095c95f286d8824bf940b2e /cpukit/score/include/rtems/score/watchdogimpl.h
parentscore: Add header to _Watchdog_Remove() (diff)
downloadrtems-6d2539413bcc0be45b6fb40e93b4012a1d91b58f.tar.bz2
score: Add _Watchdog_Acquire|Release|Flash()
Update #2307.
Diffstat (limited to 'cpukit/score/include/rtems/score/watchdogimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/watchdogimpl.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h
index ddd1ca4d1b..f52b55d83c 100644
--- a/cpukit/score/include/rtems/score/watchdogimpl.h
+++ b/cpukit/score/include/rtems/score/watchdogimpl.h
@@ -21,6 +21,7 @@
#include <rtems/score/watchdog.h>
#include <rtems/score/chainimpl.h>
+#include <rtems/score/isrlock.h>
#ifdef __cplusplus
extern "C" {
@@ -49,6 +50,11 @@ extern "C" {
*/
typedef struct {
/**
+ * @brief ISR lock to protect this watchdog chain.
+ */
+ ISR_LOCK_MEMBER( Lock )
+
+ /**
* @brief The chain of active or transient watchdogs.
*/
Chain_Control Watchdogs;
@@ -84,6 +90,30 @@ SCORE_EXTERN Watchdog_Header _Watchdog_Ticks_header;
*/
SCORE_EXTERN Watchdog_Header _Watchdog_Seconds_header;
+RTEMS_INLINE_ROUTINE void _Watchdog_Acquire(
+ Watchdog_Header *header,
+ ISR_lock_Context *lock_context
+)
+{
+ _ISR_lock_ISR_disable_and_acquire( &header->Lock, lock_context );
+}
+
+RTEMS_INLINE_ROUTINE void _Watchdog_Release(
+ Watchdog_Header *header,
+ ISR_lock_Context *lock_context
+)
+{
+ _ISR_lock_Release_and_ISR_enable( &header->Lock, lock_context );
+}
+
+RTEMS_INLINE_ROUTINE void _Watchdog_Flash(
+ Watchdog_Header *header,
+ ISR_lock_Context *lock_context
+)
+{
+ _ISR_lock_Flash( &header->Lock, lock_context );
+}
+
/**
* @brief Initialize the watchdog handler.
*