summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/isrlock.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-09 06:49:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:20:34 +0200
commit1a9d36b921306eaef671127f281500945f287822 (patch)
tree136a5da705ae644025823f77e724c7c02c58624f /cpukit/score/include/rtems/score/isrlock.h
parentscore: Fix CORE mutex initialization (diff)
downloadrtems-1a9d36b921306eaef671127f281500945f287822.tar.bz2
score: Add _ISR_lock_Is_owner()
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/isrlock.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/isrlock.h b/cpukit/score/include/rtems/score/isrlock.h
index 12afd081f1..f87f5550fc 100644
--- a/cpukit/score/include/rtems/score/isrlock.h
+++ b/cpukit/score/include/rtems/score/isrlock.h
@@ -281,6 +281,25 @@ typedef struct {
(void) _context;
#endif
+#if defined( RTEMS_DEBUG )
+ /**
+ * @brief Returns true, if the ISR lock is owned by the current processor,
+ * otherwise false.
+ *
+ * On uni-processor configurations, this function returns true, if interrupts
+ * are disabled, otherwise false.
+ *
+ * @param[in] _lock The ISR lock control.
+ */
+ #if defined( RTEMS_SMP )
+ #define _ISR_lock_Is_owner( _lock ) \
+ _SMP_lock_Is_owner( &( _lock )->Lock )
+ #else
+ #define _ISR_lock_Is_owner( _lock ) \
+ ( _ISR_Get_level() != 0 )
+ #endif
+#endif
+
/**
* @brief Flashes an ISR lock.
*