Changeset 4f5baff in rtems


Ignore:
Timestamp:
Jun 5, 2013, 3:13:14 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4fc370e
Parents:
dcb4daf8
git-author:
Sebastian Huber <sebastian.huber@…> (06/05/13 15:13:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/07/13 15:02:26)
Message:

score: Simplify _CORE_mutex_Seize_interrupt_try*

Location:
cpukit/score
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/coremutex.h

    rdcb4daf8 r4f5baff  
    282282 *
    283283 *  @param[in] the_mutex is the mutex to attempt to lock
    284  *  @param[in] level_p is the interrupt level holder
     284 *  @param[in] level is the interrupt level
    285285 *
    286286 *  @retval This routine returns 0 if "trylock" can resolve whether or not
     
    295295RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
    296296  CORE_mutex_Control  *the_mutex,
    297   ISR_Level           *level_p
     297  ISR_Level            level
    298298);
    299299
     
    308308   *
    309309   *  @param[in] the_mutex will attempt to lock
    310    *  @param[in] level_p is the interrupt level holder
     310   *  @param[in] level_p is the interrupt level
    311311   */
    312312  int _CORE_mutex_Seize_interrupt_trylock(
    313313    CORE_mutex_Control  *the_mutex,
    314     ISR_Level           *level_p
     314    ISR_Level            level
    315315  );
    316316#else
     
    320320   *
    321321   *  @param[in] _mutex will attempt to lock
    322    *  @param[in] _level_p is the interrupt level holder
    323    */
    324   #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _level_p ) \
    325      _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _level_p )
     322   *  @param[in] _level is the interrupt level
     323   */
     324  #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _level ) \
     325     _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _level )
    326326#endif
    327327
     
    395395           ); \
    396396    } \
    397     if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, &(_level) ) ) {  \
     397    if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, _level ) ) {  \
    398398      if ( !(_wait) ) { \
    399399        _ISR_Enable( _level ); \
  • cpukit/score/inline/rtems/score/coremutex.inl

    rdcb4daf8 r4f5baff  
    131131RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
    132132  CORE_mutex_Control  *the_mutex,
    133   ISR_Level           *level_p
     133  ISR_Level            level
    134134)
    135135{
     
    158158
    159159    if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
    160       _ISR_Enable( *level_p );
     160      _ISR_Enable( level );
    161161      return 0;
    162162    } /* else must be CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
     
    172172      current = executing->current_priority;
    173173      if ( current == ceiling ) {
    174         _ISR_Enable( *level_p );
     174        _ISR_Enable( level );
    175175        return 0;
    176176      }
     
    178178      if ( current > ceiling ) {
    179179        _Thread_Disable_dispatch();
    180         _ISR_Enable( *level_p );
     180        _ISR_Enable( level );
    181181        _Thread_Change_priority(
    182182          the_mutex->holder,
     
    192192        the_mutex->nest_count = 0;     /* undo locking above */
    193193        executing->resource_count--;   /* undo locking above */
    194         _ISR_Enable( *level_p );
     194        _ISR_Enable( level );
    195195        return 0;
    196196      }
     
    208208      case CORE_MUTEX_NESTING_ACQUIRES:
    209209        the_mutex->nest_count++;
    210         _ISR_Enable( *level_p );
     210        _ISR_Enable( level );
    211211        return 0;
    212212      #if defined(RTEMS_POSIX_API)
    213213        case CORE_MUTEX_NESTING_IS_ERROR:
    214214          executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
    215           _ISR_Enable( *level_p );
     215          _ISR_Enable( level );
    216216          return 0;
    217217      #endif
  • cpukit/score/src/coremutexseizeintr.c

    rdcb4daf8 r4f5baff  
    2929int _CORE_mutex_Seize_interrupt_trylock(
    3030  CORE_mutex_Control  *the_mutex,
    31   ISR_Level           *level_p
     31  ISR_Level            level
    3232)
    3333{
    34   return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p );
     34  return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level );
    3535}
    3636#endif
Note: See TracChangeset for help on using the changeset viewer.