diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-27 22:07:56 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-02 07:46:16 +0200 |
commit | 1ef8e4a8e93a848e2a68f37e029039300f1c936b (patch) | |
tree | 1a592f827f25a7803f4c70520efd8ce514a523e6 /cpukit/score/src/coretodadjust.c | |
parent | score: Streamline set time of day functions (diff) | |
download | rtems-1ef8e4a8e93a848e2a68f37e029039300f1c936b.tar.bz2 |
score: Avoid Giant lock for set time of day
Update #2555.
Update #2630.
Diffstat (limited to 'cpukit/score/src/coretodadjust.c')
-rw-r--r-- | cpukit/score/src/coretodadjust.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/cpukit/score/src/coretodadjust.c b/cpukit/score/src/coretodadjust.c index 51c10ec849..5996565e5c 100644 --- a/cpukit/score/src/coretodadjust.c +++ b/cpukit/score/src/coretodadjust.c @@ -18,14 +18,14 @@ #include "config.h" #endif -#include <rtems/score/threaddispatch.h> #include <rtems/score/todimpl.h> void _TOD_Adjust( - const Timestamp_Control delta + const Timestamp_Control *delta ) { Timestamp_Control tod; + ISR_lock_Context lock_context; /* * Currently, RTEMS does the adjustment in one movement. @@ -35,16 +35,10 @@ void _TOD_Adjust( * adjustment. */ - /* - * This prevents context switches while we are adjusting the TOD - */ - _Thread_Disable_dispatch(); - - _TOD_Get( &tod ); - - _Timestamp_Add_to( &tod, &delta ); - - _TOD_Set( &tod ); - - _Thread_Enable_dispatch(); + _TOD_Lock(); + _TOD_Acquire( &lock_context ); + _TOD_Get( &tod ); + _Timestamp_Add_to( &tod, delta ); + _TOD_Set( &tod, &lock_context ); + _TOD_Unlock(); } |