diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-01 10:11:46 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-01 16:45:45 +0200 |
commit | 8d640134ba72eecddf324c7e7496be8dd3d909ef (patch) | |
tree | 2202d48ada2066b5622768575d37585da9658c8f /cpukit/score | |
parent | score: Add and use _Thread_Update_cpu_time_used() (diff) | |
download | rtems-8d640134ba72eecddf324c7e7496be8dd3d909ef.tar.bz2 |
score: ISR lock API changes
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/include/rtems/score/isrlock.h | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/isrlock.h b/cpukit/score/include/rtems/score/isrlock.h index fb20a8e2d5..56ff19b803 100644 --- a/cpukit/score/include/rtems/score/isrlock.h +++ b/cpukit/score/include/rtems/score/isrlock.h @@ -95,13 +95,13 @@ typedef struct { * @param[in,out] _lock The ISR lock control. * @param[out] _isr_cookie The interrupt status to restore will be returned. * - * @see _ISR_lock_Release(). + * @see _ISR_lock_Release_and_ISR_enable(). */ #if defined( RTEMS_SMP ) - #define _ISR_lock_Acquire( _lock, _isr_cookie ) \ + #define _ISR_lock_ISR_disable_and_acquire( _lock, _isr_cookie ) \ _SMP_lock_ISR_disable_and_acquire( &( _lock )->lock, _isr_cookie ) #else - #define _ISR_lock_Acquire( _lock, _isr_cookie ) \ + #define _ISR_lock_ISR_disable_and_acquire( _lock, _isr_cookie ) \ do { \ (void) _lock; \ _ISR_Disable( _isr_cookie ); \ @@ -119,19 +119,63 @@ typedef struct { * @param[in,out] _lock The ISR lock control. * @param[in] _isr_cookie The interrupt status to restore. * - * @see _ISR_lock_Acquire(). + * @see _ISR_lock_ISR_disable_and_acquire(). */ #if defined( RTEMS_SMP ) - #define _ISR_lock_Release( _lock, _isr_cookie ) \ + #define _ISR_lock_Release_and_ISR_enable( _lock, _isr_cookie ) \ _SMP_lock_Release_and_ISR_enable( &( _lock )->lock, _isr_cookie ) #else - #define _ISR_lock_Release( _lock, _isr_cookie ) \ + #define _ISR_lock_Release_and_ISR_enable( _lock, _isr_cookie ) \ do { \ (void) _lock; \ _ISR_Enable( _isr_cookie ); \ } while (0) #endif +/** + * @brief Acquires an ISR lock inside an ISR disabled section. + * + * The interrupt status will remain unchanged. On SMP configurations this + * function acquires an SMP lock. + * + * In case the executing context can be interrupted by higher priority + * interrupts and these interrupts enter the critical section protected by this + * lock, then the result is unpredictable. + * + * @param[in,out] _lock The ISR lock control. + * + * @see _ISR_lock_Release(). + */ +#if defined( RTEMS_SMP ) + #define _ISR_lock_Acquire( _lock ) \ + _SMP_lock_Acquire( &( _lock )->lock ) +#else + #define _ISR_lock_Acquire( _lock ) \ + do { \ + (void) _lock; \ + } while (0) +#endif + +/** + * @brief Releases an ISR lock inside an ISR disabled section. + * + * The interrupt status will remain unchanged. On SMP configurations this + * function releases an SMP lock. + * + * @param[in,out] _lock The ISR lock control. + * + * @see _ISR_lock_Acquire(). + */ +#if defined( RTEMS_SMP ) + #define _ISR_lock_Release( _lock ) \ + _SMP_lock_Release( &( _lock )->lock ) +#else + #define _ISR_lock_Release( _lock ) \ + do { \ + (void) _lock; \ + } while (0) +#endif + /** @} */ #ifdef __cplusplus |