summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems/asrimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems/asrimpl.h')
-rw-r--r--cpukit/rtems/include/rtems/rtems/asrimpl.h66
1 files changed, 21 insertions, 45 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/asrimpl.h b/cpukit/rtems/include/rtems/rtems/asrimpl.h
index 7c1c648533..892c58c595 100644
--- a/cpukit/rtems/include/rtems/rtems/asrimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/asrimpl.h
@@ -59,41 +59,29 @@ RTEMS_INLINE_ROUTINE void _ASR_Destroy( ASR_Information *asr )
_ISR_lock_Destroy( &asr->Lock );
}
-RTEMS_INLINE_ROUTINE void _ASR_Acquire(
+RTEMS_INLINE_ROUTINE void _ASR_Acquire_critical(
ASR_Information *asr,
ISR_lock_Context *lock_context
)
{
- _ISR_lock_ISR_disable_and_acquire( &asr->Lock, lock_context );
+ _ISR_lock_Acquire( &asr->Lock, lock_context );
}
-RTEMS_INLINE_ROUTINE void _ASR_Release(
+RTEMS_INLINE_ROUTINE void _ASR_Acquire(
ASR_Information *asr,
ISR_lock_Context *lock_context
)
{
- _ISR_lock_Release_and_ISR_enable( &asr->Lock, lock_context );
+ _ISR_lock_ISR_disable( lock_context );
+ _ASR_Acquire_critical( asr, lock_context );
}
-/**
- * @brief ASR_Swap_signals
- *
- * This routine atomically swaps the pending and posted signal
- * sets. This is done when the thread alters its mode in such a
- * way that the RTEMS_ASR disable/enable flag changes.
- */
-RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
- ASR_Information *asr
+RTEMS_INLINE_ROUTINE void _ASR_Release(
+ ASR_Information *asr,
+ ISR_lock_Context *lock_context
)
{
- rtems_signal_set _signals;
- ISR_lock_Context lock_context;
-
- _ASR_Acquire( asr, &lock_context );
- _signals = asr->signals_pending;
- asr->signals_pending = asr->signals_posted;
- asr->signals_posted = _signals;
- _ASR_Release( asr, &lock_context );
+ _ISR_lock_Release_and_ISR_enable( &asr->Lock, lock_context );
}
/**
@@ -109,38 +97,26 @@ RTEMS_INLINE_ROUTINE bool _ASR_Is_null_handler (
return asr_handler == NULL;
}
-/**
- * @brief ASR_Are_signals_pending
- *
- * This function returns TRUE if there are signals pending in the
- * given RTEMS_ASR information record and FALSE otherwise.
- */
-RTEMS_INLINE_ROUTINE bool _ASR_Are_signals_pending (
- ASR_Information *asr
-)
+RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Swap_signals( ASR_Information *asr )
{
- return asr->signals_posted != 0;
+ rtems_signal_set new_signals_posted;
+ ISR_lock_Context lock_context;
+
+ _ASR_Acquire( asr, &lock_context );
+ new_signals_posted = asr->signals_pending;
+ asr->signals_pending = asr->signals_posted;
+ asr->signals_posted = new_signals_posted;
+ _ASR_Release( asr, &lock_context );
+
+ return new_signals_posted;
}
-/**
- * @brief ASR_Post_signals
- *
- * This routine posts the given signals into the signal_set
- * passed in. The result is returned to the user in signal_set.
- *
- * NOTE: This must be implemented as a macro.
- */
RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
- ASR_Information *asr,
rtems_signal_set signals,
rtems_signal_set *signal_set
)
{
- ISR_lock_Context lock_context;
-
- _ASR_Acquire( asr, &lock_context );
- *signal_set |= signals;
- _ASR_Release( asr, &lock_context );
+ *signal_set |= signals;
}
RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Get_posted_signals(