diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-07 16:01:57 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-14 09:06:27 +0100 |
commit | 77e6eba7146ba2e2074b719eec01cc7c40bbe98b (patch) | |
tree | ec87c51ccd9c53cb65067a2a06a75d29b32387f3 /cpukit/posix/src/timergetoverrun.c | |
parent | pc386: Fix linker usage issues with -r and function sections (diff) | |
download | rtems-77e6eba7146ba2e2074b719eec01cc7c40bbe98b.tar.bz2 |
score: Add and use _Objects_Get_local()
This simplifies the handling with local-only objects.
Update #2555.
Diffstat (limited to 'cpukit/posix/src/timergetoverrun.c')
-rw-r--r-- | cpukit/posix/src/timergetoverrun.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/cpukit/posix/src/timergetoverrun.c b/cpukit/posix/src/timergetoverrun.c index 0a28fa7b5f..0a7b9fafa6 100644 --- a/cpukit/posix/src/timergetoverrun.c +++ b/cpukit/posix/src/timergetoverrun.c @@ -30,27 +30,19 @@ int timer_getoverrun( timer_t timerid ) { - int overrun; POSIX_Timer_Control *ptimer; - Objects_Locations location; ISR_lock_Context lock_context; - Per_CPU_Control *cpu; - ptimer = _POSIX_Timer_Get( timerid, &location, &lock_context ); - switch ( location ) { + ptimer = _POSIX_Timer_Get( timerid, &lock_context ); + if ( ptimer != NULL ) { + Per_CPU_Control *cpu; + int overrun; - case OBJECTS_LOCAL: - cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context ); - overrun = ptimer->overrun; - ptimer->overrun = 0; - _POSIX_Timer_Release( cpu, &lock_context ); - return overrun; - -#if defined(RTEMS_MULTIPROCESSING) - case OBJECTS_REMOTE: -#endif - case OBJECTS_ERROR: - break; + cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context ); + overrun = ptimer->overrun; + ptimer->overrun = 0; + _POSIX_Timer_Release( cpu, &lock_context ); + return overrun; } rtems_set_errno_and_return_minus_one( EINVAL ); |