summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-13 15:29:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-13 15:51:21 +0200
commit80fca28198170a84cde8a9f22dbb29c3a6c4123b (patch)
treeacea5eb27023816bd447d6fe004f8f00a7830d1e /cpukit/rtems
parentscore: Delete unused state WATCHDOG_REMOVE_IT (diff)
downloadrtems-80fca28198170a84cde8a9f22dbb29c3a6c4123b.tar.bz2
score: Add _Watchdog_Preinitialize()
Add an assert to ensure that the watchdog is the proper state for a _Watchdog_Initialize(). This helps to detect invalid initializations which may lead to a corrupt watchdog chain.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/ratemoncreate.c2
-rw-r--r--cpukit/rtems/src/timercreate.c2
-rw-r--r--cpukit/rtems/src/timerserver.c1
3 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c
index 1f597ec944..1ac4a36b6e 100644
--- a/cpukit/rtems/src/ratemoncreate.c
+++ b/cpukit/rtems/src/ratemoncreate.c
@@ -65,7 +65,7 @@ rtems_status_code rtems_rate_monotonic_create(
the_period->owner = _Thread_Get_executing();
the_period->state = RATE_MONOTONIC_INACTIVE;
- _Watchdog_Initialize( &the_period->Timer, NULL, 0, NULL );
+ _Watchdog_Preinitialize( &the_period->Timer );
_Rate_monotonic_Reset_statistics( the_period );
diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c
index 13a01feda9..5c718b94c9 100644
--- a/cpukit/rtems/src/timercreate.c
+++ b/cpukit/rtems/src/timercreate.c
@@ -75,7 +75,7 @@ rtems_status_code rtems_timer_create(
}
the_timer->the_class = TIMER_DORMANT;
- _Watchdog_Initialize( &the_timer->Ticker, NULL, 0, NULL );
+ _Watchdog_Preinitialize( &the_timer->Ticker );
_Objects_Open(
&_Timer_Information,
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 047fd0978e..29e7bc4f36 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -298,6 +298,7 @@ static void _Timer_server_Initialize_watchdogs(
watchdogs->current_snapshot = now;
_Watchdog_Header_initialize( &watchdogs->Header );
+ _Watchdog_Preinitialize( &watchdogs->System_watchdog );
_Watchdog_Initialize(
&watchdogs->System_watchdog,
_Timer_server_Wakeup,