summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/isrlock.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-19 10:27:08 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-20 08:23:26 +0200
commit1981b4697e43695397cf01255805d267e0e55ab1 (patch)
tree64ee15abef295cac9348e403c3b6ca41349b3731 /cpukit/score/include/rtems/score/isrlock.h
parentscore: Refactor SMP cache manager support (diff)
downloadrtems-1981b4697e43695397cf01255805d267e0e55ab1.tar.bz2
score: Add _ISR_lock_ISR_disable/enable()
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/isrlock.h38
1 files changed, 37 insertions, 1 deletions
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