summaryrefslogtreecommitdiffstats
path: root/cpukit/score
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
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')
-rw-r--r--cpukit/score/include/rtems/score/smplock.h29
-rw-r--r--cpukit/score/src/smplock.c4
2 files changed, 22 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)
/**
diff --git a/cpukit/score/src/smplock.c b/cpukit/score/src/smplock.c
index 73fa67d74d..e921837455 100644
--- a/cpukit/score/src/smplock.c
+++ b/cpukit/score/src/smplock.c
@@ -41,6 +41,7 @@ void _SMP_lock_Acquire(
_SMP_lock_Acquire_inline( lock, context );
}
+#if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE)
void _SMP_lock_Release(
SMP_lock_Control *lock,
SMP_lock_Context *context
@@ -48,6 +49,7 @@ void _SMP_lock_Release(
{
_SMP_lock_Release_inline( lock, context );
}
+#endif
void _SMP_lock_ISR_disable_and_acquire(
SMP_lock_Control *lock,
@@ -57,6 +59,7 @@ void _SMP_lock_ISR_disable_and_acquire(
_SMP_lock_ISR_disable_and_acquire_inline( lock, context );
}
+#if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE)
void _SMP_lock_Release_and_ISR_enable(
SMP_lock_Control *lock,
SMP_lock_Context *context
@@ -64,6 +67,7 @@ void _SMP_lock_Release_and_ISR_enable(
{
_SMP_lock_Release_and_ISR_enable_inline( lock, context );
}
+#endif
#if defined(RTEMS_DEBUG)
bool _SMP_lock_Is_owner( const SMP_lock_Control *lock )