diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-16 22:24:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-17 08:38:09 +0200 |
commit | a211a732fd987057a30db919127a322f151d5f1f (patch) | |
tree | da06fb53d9814f497b9297f2b1ee404c55bd3a63 /cpukit/score/src/coretodset.c | |
parent | LEON3: gptimer drvmgr init simplified wrt boot (diff) | |
download | rtems-a211a732fd987057a30db919127a322f151d5f1f.tar.bz2 |
score: Fix _TOD_Set_with_timestamp()
Update the current time before the watchdog adjust so that timer
routines observe the new time.
Diffstat (limited to 'cpukit/score/src/coretodset.c')
-rw-r--r-- | cpukit/score/src/coretodset.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index 7c7731aae0..3d117589a1 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -36,6 +36,11 @@ void _TOD_Set_with_timestamp( _Thread_Disable_dispatch(); seconds_now = _TOD_Seconds_since_epoch(); + + _TOD_Acquire( tod, &lock_context ); + tod->now = *tod_as_timestamp; + _TOD_Release( tod, &lock_context ); + header = &_Watchdog_Seconds_header; if ( seconds_next < seconds_now ) @@ -43,10 +48,6 @@ void _TOD_Set_with_timestamp( else _Watchdog_Adjust_forward( header, seconds_next - seconds_now ); - _TOD_Acquire( tod, &lock_context ); - tod->now = *tod_as_timestamp; - _TOD_Release( tod, &lock_context ); - tod->seconds_trigger = nanoseconds; tod->is_set = true; |