summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-26 10:29:02 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-04 12:02:50 +0100
commit2b7fe35688fbeb3450ca79b7c5907811433e4fa9 (patch)
treed9bdc6629e0867a72445b4ec04fa8049a3ed23ba
parentsmptests/smpcapture01: Avoid livelock condition (diff)
downloadrtems-2b7fe35688fbeb3450ca79b7c5907811433e4fa9.tar.bz2
score: Add parameter to Giant acquire/release
Update #2273.
-rw-r--r--cpukit/score/include/rtems/score/threaddispatch.h18
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h2
-rw-r--r--cpukit/score/src/threaddispatchdisablelevel.c8
3 files changed, 18 insertions, 10 deletions
diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h
index f814072529..170067534a 100644
--- a/cpukit/score/include/rtems/score/threaddispatch.h
+++ b/cpukit/score/include/rtems/score/threaddispatch.h
@@ -97,17 +97,25 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
* This lock is implicitly acquired in
* _Thread_Dispatch_increment_disable_level().
*
- * Thread dispatching must be disabled before this lock can be acquired.
+ * Thread dispatching must be disabled before the Giant lock can be acquired
+ * and must no be enabled while owning the Giant lock. The thread dispatch
+ * disable level is not altered by this function.
+ *
+ * @param[in] cpu_self The current processor.
*/
- void _Giant_Acquire( void );
+ void _Giant_Acquire( Per_CPU_Control *cpu_self );
/**
* @brief Releases the giant lock.
*
* This lock is implicitly released in
* _Thread_Dispatch_decrement_disable_level().
+ *
+ * The thread dispatch disable level is not altered by this function.
+ *
+ * @param[in] cpu_self The current processor.
*/
- void _Giant_Release( void );
+ void _Giant_Release( Per_CPU_Control *cpu_self );
/**
* @brief Releases the giant lock completely if held by the executing processor.
@@ -116,9 +124,9 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
*
* The only use case for this operation is in _SMP_Request_shutdown().
*
- * @param[in] self_cpu The current processor.
+ * @param[in] cpu_self The current processor.
*/
- void _Giant_Drop( Per_CPU_Control *self_cpu );
+ void _Giant_Drop( Per_CPU_Control *cpu_self );
/**
* @brief Increments the thread dispatch level.
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 353093ce3a..07c5b2f12a 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -558,7 +558,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( Thread_Control *executing )
#if defined(RTEMS_SMP)
ISR_Level level;
- _Giant_Release();
+ _Giant_Release( _Per_CPU_Get() );
_ISR_Disable_without_giant( level );
( void ) level;
diff --git a/cpukit/score/src/threaddispatchdisablelevel.c b/cpukit/score/src/threaddispatchdisablelevel.c
index 3b7837c1cb..158fc39ae2 100644
--- a/cpukit/score/src/threaddispatchdisablelevel.c
+++ b/cpukit/score/src/threaddispatchdisablelevel.c
@@ -119,23 +119,23 @@ uint32_t _Thread_Dispatch_decrement_disable_level( void )
return disable_level;
}
-void _Giant_Acquire( void )
+void _Giant_Acquire( Per_CPU_Control *cpu_self )
{
ISR_Level isr_level;
_ISR_Disable_without_giant( isr_level );
_Assert( _Thread_Dispatch_disable_level != 0 );
- _Giant_Do_acquire( _Per_CPU_Get() );
+ _Giant_Do_acquire( cpu_self );
_ISR_Enable_without_giant( isr_level );
}
-void _Giant_Release( void )
+void _Giant_Release( Per_CPU_Control *cpu_self )
{
ISR_Level isr_level;
_ISR_Disable_without_giant( isr_level );
_Assert( _Thread_Dispatch_disable_level != 0 );
- _Giant_Do_release( _Per_CPU_Get() );
+ _Giant_Do_release( cpu_self );
_ISR_Enable_without_giant( isr_level );
}