Changeset 92dee4ab in rtems


Ignore:
Timestamp:
Mar 17, 2016, 5:51:56 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2f02f93
Parents:
f5bb2991
git-author:
Sebastian Huber <sebastian.huber@…> (03/17/16 05:51:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/17/16 07:27:47)
Message:

rtems: Avoid Giant lock in rtems_signal_catch()

Update #2555.

Location:
cpukit/rtems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/asrimpl.h

    rf5bb2991 r92dee4ab  
    6060}
    6161
     62RTEMS_INLINE_ROUTINE void _ASR_Acquire(
     63  ASR_Information  *asr,
     64  ISR_lock_Context *lock_context
     65)
     66{
     67  _ISR_lock_ISR_disable_and_acquire( &asr->Lock, lock_context );
     68}
     69
     70RTEMS_INLINE_ROUTINE void _ASR_Release(
     71  ASR_Information  *asr,
     72  ISR_lock_Context *lock_context
     73)
     74{
     75  _ISR_lock_Release_and_ISR_enable( &asr->Lock, lock_context );
     76}
     77
    6278/**
    6379 *  @brief ASR_Swap_signals
     
    7490  ISR_lock_Context lock_context;
    7591
    76   _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
     92  _ASR_Acquire( asr, &lock_context );
    7793    _signals             = asr->signals_pending;
    7894    asr->signals_pending = asr->signals_posted;
    7995    asr->signals_posted  = _signals;
    80   _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
     96  _ASR_Release( asr, &lock_context );
    8197}
    8298
     
    123139  ISR_lock_Context lock_context;
    124140
    125   _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
     141  _ASR_Acquire( asr, &lock_context );
    126142    *signal_set |= signals;
    127   _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
     143  _ASR_Release( asr, &lock_context );
    128144}
    129145
     
    135151  ISR_lock_Context lock_context;
    136152
    137   _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
     153  _ASR_Acquire( asr, &lock_context );
    138154    signal_set = asr->signals_posted;
    139155    asr->signals_posted = 0;
    140   _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
     156  _ASR_Release( asr, &lock_context );
    141157
    142158  return signal_set;
  • cpukit/rtems/src/signalcatch.c

    rf5bb2991 r92dee4ab  
    7373  RTEMS_API_Control  *api;
    7474  ASR_Information    *asr;
     75  ISR_lock_Context    lock_context;
    7576
    7677  executing = _Thread_Get_executing();
     
    7879  asr = &api->Signal;
    7980
    80   _Thread_Disable_dispatch(); /* cannot reschedule while */
    81                               /*   the thread is inconsistent */
     81  _ASR_Acquire( asr, &lock_context );
    8282
    8383  if ( !_ASR_Is_null_handler( asr_handler ) ) {
    8484    asr->mode_set = mode_set;
    8585    asr->handler = asr_handler;
     86  } else {
     87    _ASR_Initialize( asr );
    8688  }
    87   else
    88     _ASR_Initialize( asr );
    89   _Thread_Enable_dispatch();
     89
     90  _ASR_Release( asr, &lock_context );
    9091  return RTEMS_SUCCESSFUL;
    9192}
Note: See TracChangeset for help on using the changeset viewer.