From 1981b4697e43695397cf01255805d267e0e55ab1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 19 Apr 2015 10:27:08 +0200 Subject: score: Add _ISR_lock_ISR_disable/enable() --- cpukit/score/include/rtems/score/isrlock.h | 38 +++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'cpukit/score/include/rtems/score/isrlock.h') diff --git a/cpukit/score/include/rtems/score/isrlock.h b/cpukit/score/include/rtems/score/isrlock.h index 8449d5d64f..5a68937b4d 100644 --- a/cpukit/score/include/rtems/score/isrlock.h +++ b/cpukit/score/include/rtems/score/isrlock.h @@ -184,7 +184,7 @@ typedef struct { * This function can be used in thread and interrupt context. * * @param[in] _lock The ISR lock control. - * @param[in] context The local ISR lock context for an acquire and release + * @param[in] _context The local ISR lock context for an acquire and release * pair. * * @see _ISR_lock_Release_and_ISR_enable(). @@ -304,6 +304,42 @@ typedef struct { _ISR_Flash( ( _context )->isr_level ) #endif +/** + * @brief Disables interrupts and saves the previous interrupt state in the ISR + * lock context. + * + * This function can be used in thread and interrupt context. + * + * @param[in] _context The local ISR lock context to store the interrupt state. + * + * @see _ISR_lock_ISR_enable(). + */ +#if defined( RTEMS_SMP ) + #define _ISR_lock_ISR_disable( _context ) \ + _ISR_Disable_without_giant( ( _context )->Lock_context.isr_level ) +#else + #define _ISR_lock_ISR_disable( _context ) \ + _ISR_Disable( ( _context )->isr_level ) +#endif + +/** + * @brief Restores the saved interrupt state of the ISR lock context. + * + * This function can be used in thread and interrupt context. + * + * @param[in] _context The local ISR lock context containing the saved + * interrupt state. + * + * @see _ISR_lock_ISR_disable(). + */ +#if defined( RTEMS_SMP ) + #define _ISR_lock_ISR_enable( _context ) \ + _ISR_Enable_without_giant( ( _context )->Lock_context.isr_level ) +#else + #define _ISR_lock_ISR_enable( _context ) \ + _ISR_Enable( ( _context )->isr_level ) +#endif + /** @} */ #ifdef __cplusplus -- cgit v1.2.3