summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coretodadjust.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-27 22:07:56 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-02 07:46:16 +0200
commit1ef8e4a8e93a848e2a68f37e029039300f1c936b (patch)
tree1a592f827f25a7803f4c70520efd8ce514a523e6 /cpukit/score/src/coretodadjust.c
parentscore: Streamline set time of day functions (diff)
downloadrtems-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.c22
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();
}