From 1a9d36b921306eaef671127f281500945f287822 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 9 May 2016 06:49:53 +0200 Subject: score: Add _ISR_lock_Is_owner() --- cpukit/score/include/rtems/score/isrlock.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (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 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. * -- cgit v1.2.3