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/coretodset.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 '')
-rw-r--r-- | cpukit/score/src/coretodset.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index e11f47c904..f1d2e36eb0 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -19,11 +19,12 @@ #endif #include <rtems/score/todimpl.h> -#include <rtems/score/threaddispatch.h> +#include <rtems/score/assert.h> #include <rtems/score/watchdogimpl.h> void _TOD_Set( - const Timestamp_Control *tod_as_timestamp + const Timestamp_Control *tod_as_timestamp, + ISR_lock_Context *lock_context ) { struct timespec tod_as_timespec; @@ -31,12 +32,11 @@ void _TOD_Set( uint32_t cpu_count; uint32_t cpu_index; - _Timestamp_To_timespec( tod_as_timestamp, &tod_as_timespec ); - - _Thread_Disable_dispatch(); + _Assert( _API_Mutex_Is_owner( _Once_Mutex ) ); - _Timecounter_Set_clock( &tod_as_timespec ); + _Timecounter_Set_clock( tod_as_timestamp, lock_context ); + _Timestamp_To_timespec( tod_as_timestamp, &tod_as_timespec ); tod_as_ticks = _Watchdog_Ticks_from_timespec( &tod_as_timespec ); cpu_count = _SMP_Get_processor_count(); @@ -47,6 +47,4 @@ void _TOD_Set( } _TOD.is_set = true; - - _Thread_Enable_dispatch(); } |