From 8daaa215567c4016b24c8e0c7b019b15b0e907e2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Jan 2008 21:11:04 +0000 Subject: 2008-01-09 Joel Sherrill * score/include/rtems/score/coremutex.h, score/src/coremutexseizeintr.c: Fix conditional code for inlining _CORE_mutex_Seize_interrupt_trylock() and add comments. --- cpukit/score/include/rtems/score/coremutex.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index 59a6b6f1f9..f78232a0fb 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -291,14 +291,24 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body( ISR_Level *level_p ); -#if !defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) - #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _level ) \ - _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _level ) -#else +#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) + /* + * When doing test coverage analysis or trying to minimize the code + * space for RTEMS, it is often helpful to not inline this method + * multiple times. It is fairly large and has a high branch complexity + * which makes it harder to get full binary test coverage. + */ int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ); +#else + /* + * The default is to favor speed and inlining this definitely saves + * a few instructions. This is very important for mutex performance. + */ + #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _level ) \ + _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _level ) #endif /** -- cgit v1.2.3