diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-21 15:57:22 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-21 15:57:22 +0000 |
commit | e2ba62d1ea181d8057c6c3f6ba2e9dc651f6aa3a (patch) | |
tree | 3ba6fcde8d360aa8552a7667159b04f67051c27b | |
parent | 2007-12-21 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-e2ba62d1ea181d8057c6c3f6ba2e9dc651f6aa3a.tar.bz2 |
2007-12-21 Joel Sherrill <joel.sherrill@OARcorp.com>
* configure.ac, score/include/rtems/score/coremutex.h,
score/inline/rtems/score/coremutex.inl: Add the ability to disable
inlining coremutex seize. This reduces the code size and also
improves the process of coverage analysis.
* score/src/coremutexseizeintr.c: New file.
-rw-r--r-- | cpukit/ChangeLog | 8 | ||||
-rw-r--r-- | cpukit/configure.ac | 9 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremutex.h | 21 | ||||
-rw-r--r-- | cpukit/score/src/coremutexseizeintr.c | 31 |
4 files changed, 66 insertions, 3 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 9074523e82..a4304638fb 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2007-12-21 Joel Sherrill <joel.sherrill@OARcorp.com> + + * configure.ac, score/include/rtems/score/coremutex.h, + score/inline/rtems/score/coremutex.inl: Add the ability to disable + inlining coremutex seize. This reduces the code size and also + improves the process of coverage analysis. + * score/src/coremutexseizeintr.c: New file. + 2007-12-21 Xi Yang <hiyangxi@gmail.com> * configure.ac, score/include/rtems/score/coremutex.h, diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 04f2997d4a..f2faabf915 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -218,12 +218,21 @@ RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__], [disable nanosecond granularity for period statistics] ) +## This improves both the size and coverage analysis. RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__], [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"], [1], [disable inlining _Thread_Enable_dispatch] ) +## This improves both the size and coverage analysis. +RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__], + [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"], + [1], + [disable inlining _Thread_Enable_dispatch] +) + +## This gives the same behavior as 4.8 and older RTEMS_CPUOPT([__STRICT_ORDER_MUTEX__], [test x"${ENABLE_STRICT_ORDER_MUTEX}"=x"1"], [1], diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index b61c8476e4..59a6b6f1f9 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -41,6 +41,7 @@ extern "C" { #include <rtems/score/interr.h> #include <rtems/score/sysstate.h> + /** * @brief MP Support Callback Prototype * @@ -102,16 +103,19 @@ typedef enum { * because the resource never became available. */ CORE_MUTEX_TIMEOUT, + #ifdef __STRICT_ORDER_MUTEX__ /** This status indicates that a thread not release the mutex which has * the priority inheritance property in a right order. */ CORE_MUTEX_RELEASE_NOT_ORDER, #endif + /** This status indicates that a thread of logically greater importance * than the ceiling priority attempted to lock this mutex. */ CORE_MUTEX_STATUS_CEILING_VIOLATED, + } CORE_mutex_Status; /** @@ -190,7 +194,7 @@ typedef struct { } CORE_mutex_Attributes; #ifdef __STRICT_ORDER_MUTEX__ -/*@brief Core Mutex Lock_Chain Struct +/*@beief Core Mutex Lock_Chain Struct * * The following defines the control block used to manage lock chain of * priority inheritance mutex. @@ -239,7 +243,7 @@ typedef struct { /** This element contains the object Id of the holding thread. */ Objects_Id holder_id; #ifdef __STRICT_ORDER_MUTEX__ - /** This field is used to manipulate the priority inheritance mutex queue. */ + /** This field is used to manipulate the priority inheritance mutex queue*/ CORE_mutex_order_list queue; #endif @@ -281,11 +285,22 @@ void _CORE_mutex_Initialize( * @note For performance reasons, this routine is implemented as * a macro that uses two support routines. */ -int _CORE_mutex_Seize_interrupt_trylock( + +RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body( CORE_mutex_Control *the_mutex, 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 + int _CORE_mutex_Seize_interrupt_trylock( + CORE_mutex_Control *the_mutex, + ISR_Level *level_p + ); +#endif + /** * @brief Seize Mutex with Blocking * diff --git a/cpukit/score/src/coremutexseizeintr.c b/cpukit/score/src/coremutexseizeintr.c new file mode 100644 index 0000000000..f8363cd637 --- /dev/null +++ b/cpukit/score/src/coremutexseizeintr.c @@ -0,0 +1,31 @@ +/* + * Mutex Handler -- Seize interrupt disable version + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/system.h> +#include <rtems/score/isr.h> +#include <rtems/score/coremutex.h> +#include <rtems/score/states.h> +#include <rtems/score/thread.h> +#include <rtems/score/threadq.h> + +int _CORE_mutex_Seize_interrupt_trylock( + CORE_mutex_Control *the_mutex, + ISR_Level *level_p +) +{ + return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); +} |