diff options
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(); } |