From 92dee4ab9cf806553d0cdaeb4968d25ced4a8b3a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 17 Mar 2016 06:51:56 +0100 Subject: rtems: Avoid Giant lock in rtems_signal_catch() Update #2555. --- cpukit/rtems/include/rtems/rtems/asrimpl.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'cpukit/rtems/include/rtems/rtems/asrimpl.h') diff --git a/cpukit/rtems/include/rtems/rtems/asrimpl.h b/cpukit/rtems/include/rtems/rtems/asrimpl.h index bcfb69a558..7c1c648533 100644 --- a/cpukit/rtems/include/rtems/rtems/asrimpl.h +++ b/cpukit/rtems/include/rtems/rtems/asrimpl.h @@ -59,6 +59,22 @@ RTEMS_INLINE_ROUTINE void _ASR_Destroy( ASR_Information *asr ) _ISR_lock_Destroy( &asr->Lock ); } +RTEMS_INLINE_ROUTINE void _ASR_Acquire( + ASR_Information *asr, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_ISR_disable_and_acquire( &asr->Lock, lock_context ); +} + +RTEMS_INLINE_ROUTINE void _ASR_Release( + ASR_Information *asr, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Release_and_ISR_enable( &asr->Lock, lock_context ); +} + /** * @brief ASR_Swap_signals * @@ -73,11 +89,11 @@ RTEMS_INLINE_ROUTINE void _ASR_Swap_signals ( rtems_signal_set _signals; ISR_lock_Context lock_context; - _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); + _ASR_Acquire( asr, &lock_context ); _signals = asr->signals_pending; asr->signals_pending = asr->signals_posted; asr->signals_posted = _signals; - _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context ); + _ASR_Release( asr, &lock_context ); } /** @@ -122,9 +138,9 @@ RTEMS_INLINE_ROUTINE void _ASR_Post_signals( { ISR_lock_Context lock_context; - _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); + _ASR_Acquire( asr, &lock_context ); *signal_set |= signals; - _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context ); + _ASR_Release( asr, &lock_context ); } RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Get_posted_signals( @@ -134,10 +150,10 @@ RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Get_posted_signals( rtems_signal_set signal_set; ISR_lock_Context lock_context; - _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); + _ASR_Acquire( asr, &lock_context ); signal_set = asr->signals_posted; asr->signals_posted = 0; - _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context ); + _ASR_Release( asr, &lock_context ); return signal_set; } -- cgit v1.2.3