summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/smplock.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-09 13:14:38 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-09 15:19:59 +0100
commiteb98dd49bceba1dc0e1bd63a47492a53c0b0193f (patch)
tree5d848781816cb5a5e8f67a73c46193f4fe059dff /cpukit/score/include/rtems/score/smplock.h
parentProvide kernel space header files (diff)
downloadrtems-eb98dd49bceba1dc0e1bd63a47492a53c0b0193f.tar.bz2
score: Inline some SMP lock operations by default
The SMP ticket lock release turned out to be suitable for inlining, e.g. a hand full of instructions, no branches. The changes in the screen files do not reflect the changes due to this commit. However, they are now up to date. Obtained on a T4240 running at 1.5GHz using GCC 7.0.0 20161108..
Diffstat (limited to 'cpukit/score/include/rtems/score/smplock.h')
-rw-r--r--cpukit/score/include/rtems/score/smplock.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/cpukit/score/include/rtems/score/smplock.h b/cpukit/score/include/rtems/score/smplock.h
index c2214e6ab1..28022041ed 100644
--- a/cpukit/score/include/rtems/score/smplock.h
+++ b/cpukit/score/include/rtems/score/smplock.h
@@ -55,6 +55,10 @@ extern "C" {
* @{
*/
+#if defined(RTEMS_DEBUG) || defined(RTEMS_PROFILING)
+#define RTEMS_SMP_LOCK_DO_NOT_INLINE
+#endif
+
/**
* @brief SMP lock control.
*/
@@ -148,13 +152,8 @@ void _SMP_lock_Initialize(
const char * name
);
#else
-static inline void _SMP_lock_Initialize(
- SMP_lock_Control *lock,
- const char *name
-)
-{
- _SMP_lock_Initialize_inline( lock, name );
-}
+#define _SMP_lock_Initialize( lock, name ) \
+ _SMP_lock_Initialize_inline( lock, name )
#endif
static inline void _SMP_lock_Destroy_inline( SMP_lock_Control *lock )
@@ -173,10 +172,8 @@ static inline void _SMP_lock_Destroy_inline( SMP_lock_Control *lock )
#if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE)
void _SMP_lock_Destroy( SMP_lock_Control *lock );
#else
-static inline void _SMP_lock_Destroy( SMP_lock_Control *lock )
-{
- _SMP_lock_Destroy_inline( lock );
-}
+#define _SMP_lock_Destroy( lock ) \
+ _SMP_lock_Destroy_inline( lock )
#endif
static inline void _SMP_lock_Acquire_inline(
@@ -241,10 +238,15 @@ static inline void _SMP_lock_Release_inline(
* @param[in] context The local SMP lock context for an acquire and release
* pair.
*/
+#if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE)
void _SMP_lock_Release(
SMP_lock_Control *lock,
SMP_lock_Context *context
);
+#else
+#define _SMP_lock_Release( lock, context ) \
+ _SMP_lock_Release_inline( lock, context )
+#endif
static inline void _SMP_lock_ISR_disable_and_acquire_inline(
SMP_lock_Control *lock,
@@ -283,10 +285,15 @@ static inline void _SMP_lock_Release_and_ISR_enable_inline(
* @param[in] context The local SMP lock context for an acquire and release
* pair.
*/
+#if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE)
void _SMP_lock_Release_and_ISR_enable(
SMP_lock_Control *lock,
SMP_lock_Context *context
);
+#else
+#define _SMP_lock_Release_and_ISR_enable( lock, context ) \
+ _SMP_lock_Release_and_ISR_enable_inline( lock, context )
+#endif
#if defined(RTEMS_DEBUG)
/**