From 9cd53495d292ace4df6101d2a6f80c34b3c42e8d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 3 Nov 2016 17:00:28 +0100 Subject: score: Default to non-inline SMP lock ops Use non-inline SMP lock acquire and release operations by default. Provide inline variants for the hot spots, e.g. mutex acquire/release. --- cpukit/score/src/smplock.c | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/smplock.c b/cpukit/score/src/smplock.c index f6cc8b6d81..73fa67d74d 100644 --- a/cpukit/score/src/smplock.c +++ b/cpukit/score/src/smplock.c @@ -17,36 +17,28 @@ #endif #include -#include -#include #if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE) - void _SMP_lock_Initialize( SMP_lock_Control *lock, const char *name ) { - _SMP_lock_Initialize_body( lock, name ); + _SMP_lock_Initialize_inline( lock, name ); } void _SMP_lock_Destroy( SMP_lock_Control *lock ) { - _SMP_lock_Destroy_body( lock ); + _SMP_lock_Destroy_inline( lock ); } +#endif void _SMP_lock_Acquire( SMP_lock_Control *lock, SMP_lock_Context *context ) { -#if defined(RTEMS_DEBUG) - context->lock_used_for_acquire = lock; -#endif - _SMP_lock_Acquire_body( lock, context ); -#if defined(RTEMS_DEBUG) - lock->owner = _SMP_Get_current_processor(); -#endif + _SMP_lock_Acquire_inline( lock, context ); } void _SMP_lock_Release( @@ -54,13 +46,7 @@ void _SMP_lock_Release( SMP_lock_Context *context ) { -#if defined(RTEMS_DEBUG) - _Assert( context->lock_used_for_acquire == lock ); - context->lock_used_for_acquire = NULL; - _Assert( lock->owner == _SMP_Get_current_processor() ); - lock->owner = SMP_LOCK_NO_OWNER; -#endif - _SMP_lock_Release_body( lock, context ); + _SMP_lock_Release_inline( lock, context ); } void _SMP_lock_ISR_disable_and_acquire( @@ -68,13 +54,7 @@ void _SMP_lock_ISR_disable_and_acquire( SMP_lock_Context *context ) { -#if defined(RTEMS_DEBUG) - context->lock_used_for_acquire = lock; -#endif - _SMP_lock_ISR_disable_and_acquire_body( lock, context ); -#if defined(RTEMS_DEBUG) - lock->owner = _SMP_Get_current_processor(); -#endif + _SMP_lock_ISR_disable_and_acquire_inline( lock, context ); } void _SMP_lock_Release_and_ISR_enable( @@ -82,14 +62,7 @@ void _SMP_lock_Release_and_ISR_enable( SMP_lock_Context *context ) { -#if defined(RTEMS_DEBUG) - _Assert( context->lock_used_for_acquire == lock ); - context->lock_used_for_acquire = NULL; - _Assert( lock->owner == _SMP_Get_current_processor() ); - lock->owner = SMP_LOCK_NO_OWNER; -#endif - _SMP_lock_Release_body( lock, context ); - _ISR_Local_enable( context->isr_level ); + _SMP_lock_Release_and_ISR_enable_inline( lock, context ); } #if defined(RTEMS_DEBUG) @@ -98,5 +71,3 @@ bool _SMP_lock_Is_owner( const SMP_lock_Control *lock ) return lock->owner == _SMP_Get_current_processor(); } #endif - -#endif /* defined(RTEMS_SMP_LOCK_DO_NOT_INLINE) */ -- cgit v1.2.3