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.
This commit is contained in:
Joel Sherrill
2007-12-21 15:57:22 +00:00
parent 03c6ff399e
commit e2ba62d1ea
4 changed files with 66 additions and 3 deletions

View File

@@ -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,

View File

@@ -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],

View File

@@ -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
*

View File

@@ -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 );
}