diff options
Diffstat (limited to 'cpukit/rtems/src/timergetinfo.c')
-rw-r--r-- | cpukit/rtems/src/timergetinfo.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cpukit/rtems/src/timergetinfo.c b/cpukit/rtems/src/timergetinfo.c index 17c32e6cf4..a11861c63e 100644 --- a/cpukit/rtems/src/timergetinfo.c +++ b/cpukit/rtems/src/timergetinfo.c @@ -32,19 +32,22 @@ rtems_status_code rtems_timer_get_information( { Timer_Control *the_timer; Objects_Locations location; + ISR_lock_Context lock_context; + Per_CPU_Control *cpu; if ( !the_info ) return RTEMS_INVALID_ADDRESS; - the_timer = _Timer_Get( id, &location ); + the_timer = _Timer_Get( id, &location, &lock_context ); switch ( location ) { case OBJECTS_LOCAL: + cpu = _Timer_Acquire_critical( the_timer, &lock_context ); the_info->the_class = the_timer->the_class; - the_info->initial = the_timer->Ticker.initial; - the_info->start_time = the_timer->Ticker.start_time; - the_info->stop_time = the_timer->Ticker.stop_time; - _Objects_Put( &the_timer->Object ); + the_info->initial = the_timer->initial; + the_info->start_time = the_timer->start_time; + the_info->stop_time = the_timer->stop_time; + _Timer_Release( cpu, &lock_context ); return RTEMS_SUCCESSFUL; #if defined(RTEMS_MULTIPROCESSING) |