[rtems commit] score: Add parameter to Giant acquire/release
Sebastian Huber
sebh at rtems.org
Wed Mar 4 11:05:25 UTC 2015
Module: rtems
Branch: master
Commit: 2b7fe35688fbeb3450ca79b7c5907811433e4fa9
Changeset: http://git.rtems.org/rtems/commit/?id=2b7fe35688fbeb3450ca79b7c5907811433e4fa9
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Feb 26 10:29:02 2015 +0100
score: Add parameter to Giant acquire/release
Update #2273.
---
cpukit/score/include/rtems/score/threaddispatch.h | 18 +++++++++++++-----
cpukit/score/include/rtems/score/threadimpl.h | 2 +-
cpukit/score/src/threaddispatchdisablelevel.c | 8 ++++----
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 f814072..1700675 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 353093c..07c5b2f 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 3b7837c..158fc39 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 );
}
More information about the vc
mailing list