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 | |
parent | score: Add and use _Thread_Update_cpu_time_used() (diff) | |
download | rtems-8d640134ba72eecddf324c7e7496be8dd3d909ef.tar.bz2 |
score: ISR lock API changes
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/intr.h | 26 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/isrlock.h | 56 |
2 files changed, 56 insertions, 26 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/intr.h b/cpukit/rtems/include/rtems/rtems/intr.h index ae6dfcc59e..2f5b9ba61e 100644 --- a/cpukit/rtems/include/rtems/rtems/intr.h +++ b/cpukit/rtems/include/rtems/rtems/intr.h @@ -186,7 +186,7 @@ typedef ISR_lock_Control rtems_interrupt_lock; * @see rtems_interrupt_lock_release(). */ #define rtems_interrupt_lock_acquire( _lock, _isr_cookie ) \ - _ISR_lock_Acquire( _lock, _isr_cookie ) + _ISR_lock_ISR_disable_and_acquire( _lock, _isr_cookie ) /** * @brief Releases an interrupt lock. @@ -202,7 +202,7 @@ typedef ISR_lock_Control rtems_interrupt_lock; * @see rtems_interrupt_lock_acquire(). */ #define rtems_interrupt_lock_release( _lock, _isr_cookie ) \ - _ISR_lock_Release( _lock, _isr_cookie ) + _ISR_lock_Release_and_ISR_enable( _lock, _isr_cookie ) /** * @brief Acquires an interrupt lock in the corresponding interrupt service @@ -219,15 +219,8 @@ typedef ISR_lock_Control rtems_interrupt_lock; * * @see rtems_interrupt_lock_release_isr(). */ -#if defined( RTEMS_SMP ) - #define rtems_interrupt_lock_acquire_isr( _lock ) \ - _SMP_lock_Acquire( &( _lock )->lock ) -#else - #define rtems_interrupt_lock_acquire_isr( _lock ) \ - do { \ - (void) _lock; \ - } while (0) -#endif +#define rtems_interrupt_lock_acquire_isr( _lock ) \ + _ISR_lock_Acquire( _lock ) /** * @brief Releases an interrupt lock in the corresponding interrupt service @@ -240,15 +233,8 @@ typedef ISR_lock_Control rtems_interrupt_lock; * * @see rtems_interrupt_lock_acquire_isr(). */ -#if defined( RTEMS_SMP ) - #define rtems_interrupt_lock_release_isr( _lock ) \ - _SMP_lock_Release( &( _lock )->lock ) -#else - #define rtems_interrupt_lock_release_isr( _lock ) \ - do { \ - (void) _lock; \ - } while (0) -#endif +#define rtems_interrupt_lock_release_isr( _lock ) \ + _ISR_lock_Release( _lock ) /** @} */ 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 |