summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/timergetinfo.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-07 16:01:57 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-14 09:06:27 +0100
commit77e6eba7146ba2e2074b719eec01cc7c40bbe98b (patch)
treeec87c51ccd9c53cb65067a2a06a75d29b32387f3 /cpukit/rtems/src/timergetinfo.c
parentpc386: Fix linker usage issues with -r and function sections (diff)
downloadrtems-77e6eba7146ba2e2074b719eec01cc7c40bbe98b.tar.bz2
score: Add and use _Objects_Get_local()
This simplifies the handling with local-only objects. Update #2555.
Diffstat (limited to 'cpukit/rtems/src/timergetinfo.c')
-rw-r--r--cpukit/rtems/src/timergetinfo.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/cpukit/rtems/src/timergetinfo.c b/cpukit/rtems/src/timergetinfo.c
index a11861c63e..804b0cf3b0 100644
--- a/cpukit/rtems/src/timergetinfo.c
+++ b/cpukit/rtems/src/timergetinfo.c
@@ -18,43 +18,30 @@
#include "config.h"
#endif
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
#include <rtems/rtems/timerimpl.h>
-#include <rtems/score/watchdog.h>
rtems_status_code rtems_timer_get_information(
rtems_id id,
rtems_timer_information *the_info
)
{
- Timer_Control *the_timer;
- Objects_Locations location;
- ISR_lock_Context lock_context;
- Per_CPU_Control *cpu;
+ Timer_Control *the_timer;
+ ISR_lock_Context lock_context;
if ( !the_info )
return RTEMS_INVALID_ADDRESS;
- 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->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)
- case OBJECTS_REMOTE: /* should never return this */
-#endif
- case OBJECTS_ERROR:
- break;
+ the_timer = _Timer_Get( id, &lock_context );
+ if ( the_timer != NULL ) {
+ Per_CPU_Control *cpu;
+
+ cpu = _Timer_Acquire_critical( the_timer, &lock_context );
+ the_info->the_class = the_timer->the_class;
+ 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;
}
return RTEMS_INVALID_ID;