summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-20 09:49:39 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-21 08:25:31 +0200
commit413b9e286d89bd0ddb70191df27218439170989b (patch)
treeb364a9ba3e3ceb088fc7e729707c57498b099947
parentscore: _Objects_Get_isr_disable() (diff)
downloadrtems-413b9e286d89bd0ddb70191df27218439170989b.tar.bz2
score: Modify _Thread_Dispatch_disable_critical()
Return the current processor to be in line with _Thread_Disable_dispatch().
-rw-r--r--cpukit/score/include/rtems/score/objectimpl.h4
-rw-r--r--cpukit/score/include/rtems/score/threaddispatch.h16
2 files changed, 11 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h
index a96dc208ab..cf14c2db5c 100644
--- a/cpukit/score/include/rtems/score/objectimpl.h
+++ b/cpukit/score/include/rtems/score/objectimpl.h
@@ -674,9 +674,9 @@ _Objects_Release_and_thread_dispatch_disable(
ISR_lock_Context *lock_context
)
{
- Per_CPU_Control *cpu_self = _Per_CPU_Get();
+ Per_CPU_Control *cpu_self;
- _Thread_Dispatch_disable_critical( cpu_self );
+ cpu_self = _Thread_Dispatch_disable_critical();
_Objects_Release_and_ISR_enable( the_object, lock_context );
return cpu_self;
diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h
index f8c3611674..89f5c0ba5b 100644
--- a/cpukit/score/include/rtems/score/threaddispatch.h
+++ b/cpukit/score/include/rtems/score/threaddispatch.h
@@ -242,16 +242,19 @@ void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level );
*
* This function does not acquire the Giant lock.
*
- * @param[in] cpu_self The current processor.
+ * @return The current processor.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_disable_critical(
- Per_CPU_Control *cpu_self
-)
+RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical( void )
{
- uint32_t disable_level = cpu_self->thread_dispatch_disable_level;
+ Per_CPU_Control *cpu_self;
+ uint32_t disable_level;
+ cpu_self = _Per_CPU_Get();
+ disable_level = cpu_self->thread_dispatch_disable_level;
_Profiling_Thread_dispatch_disable( cpu_self, disable_level );
cpu_self->thread_dispatch_disable_level = disable_level + 1;
+
+ return cpu_self;
}
/**
@@ -271,8 +274,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable( void )
_ISR_Disable_without_giant( level );
#endif
- cpu_self = _Per_CPU_Get();
- _Thread_Dispatch_disable_critical( cpu_self );
+ cpu_self = _Thread_Dispatch_disable_critical();
#if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
_ISR_Enable_without_giant( level );