RTEMS  5.1
Macros | Typedefs
Interrupt Locks

Low-level lock to protect critical sections accessed by threads and interrupt service routines. More...

Macros

#define RTEMS_INTERRUPT_LOCK_MEMBER(_designator)   ISR_LOCK_MEMBER( _designator )
 Defines an interrupt lock member. More...
 
#define RTEMS_INTERRUPT_LOCK_DECLARE(_qualifier, _designator)   ISR_LOCK_DECLARE( _qualifier, _designator )
 Declares an interrupt lock variable. More...
 
#define RTEMS_INTERRUPT_LOCK_DEFINE(_qualifier, _designator, _name)   ISR_LOCK_DEFINE( _qualifier, _designator, _name )
 Defines an interrupt lock variable. More...
 
#define RTEMS_INTERRUPT_LOCK_REFERENCE(_designator, _target)   ISR_LOCK_REFERENCE( _designator, _target )
 Defines an interrupt lock variable reference. More...
 
#define RTEMS_INTERRUPT_LOCK_INITIALIZER(_name)   ISR_LOCK_INITIALIZER( _name )
 Initializer for static initialization of interrupt locks. More...
 
#define rtems_interrupt_lock_initialize(_lock, _name)   _ISR_lock_Initialize( _lock, _name )
 Initializes an interrupt lock. More...
 
#define rtems_interrupt_lock_destroy(_lock)   _ISR_lock_Destroy( _lock )
 Destroys an interrupt lock. More...
 
#define rtems_interrupt_lock_interrupt_disable(_lock_context)   _ISR_lock_ISR_disable( _lock_context )
 Disables interrupts on the current processor. More...
 
#define rtems_interrupt_lock_acquire(_lock, _lock_context)   _ISR_lock_ISR_disable_and_acquire( _lock, _lock_context )
 Acquires an interrupt lock. More...
 
#define rtems_interrupt_lock_release(_lock, _lock_context)   _ISR_lock_Release_and_ISR_enable( _lock, _lock_context )
 Releases an interrupt lock. More...
 
#define rtems_interrupt_lock_acquire_isr(_lock, _lock_context)   do { (void) _lock_context; } while ( 0 )
 Acquires an interrupt lock in the corresponding interrupt service routine. More...
 
#define rtems_interrupt_lock_release_isr(_lock, _lock_context)   do { (void) _lock_context; } while ( 0 )
 Releases an interrupt lock in the corresponding interrupt service routine. More...
 

Typedefs

typedef ISR_lock_Control rtems_interrupt_lock
 Interrupt lock control.
 
typedef ISR_lock_Context rtems_interrupt_lock_context
 Local interrupt lock context for acquire and release pairs.
 

Detailed Description

Low-level lock to protect critical sections accessed by threads and interrupt service routines.

On single processor configurations the interrupt locks degrade to simple interrupt disable/enable sequences. No additional storage or objects are required.

This synchronization primitive is supported on SMP configurations. Here SMP locks are used.

Macro Definition Documentation

◆ rtems_interrupt_lock_acquire

#define rtems_interrupt_lock_acquire (   _lock,
  _lock_context 
)    _ISR_lock_ISR_disable_and_acquire( _lock, _lock_context )

Acquires an interrupt lock.

Interrupts will be disabled. On SMP configurations this function acquires an SMP lock.

This function can be used in thread and interrupt context.

Parameters
[in,out]_lockThe interrupt lock.
[in,out]_lock_contextThe local interrupt lock context for an acquire and release pair.
See also
rtems_interrupt_lock_release().

◆ rtems_interrupt_lock_acquire_isr

#define rtems_interrupt_lock_acquire_isr (   _lock,
  _lock_context 
)    do { (void) _lock_context; } while ( 0 )

Acquires an interrupt lock in the corresponding interrupt service routine.

The interrupt status will remain unchanged. On SMP configurations this function acquires an SMP lock.

In case the corresponding interrupt service routine can be interrupted by higher priority interrupts and these interrupts enter the critical section protected by this lock, then the result is unpredictable.

Parameters
[in,out]_lockThe interrupt lock.
[in,out]_lock_contextThe local interrupt lock context for an acquire and release pair.
See also
rtems_interrupt_lock_release_isr().

◆ RTEMS_INTERRUPT_LOCK_DECLARE

#define RTEMS_INTERRUPT_LOCK_DECLARE (   _qualifier,
  _designator 
)    ISR_LOCK_DECLARE( _qualifier, _designator )

Declares an interrupt lock variable.

Do not add a ';' after this macro.

Parameters
_qualifierThe qualifier for the interrupt lock, e.g. extern.
_designatorThe designator for the interrupt lock.

◆ RTEMS_INTERRUPT_LOCK_DEFINE

#define RTEMS_INTERRUPT_LOCK_DEFINE (   _qualifier,
  _designator,
  _name 
)    ISR_LOCK_DEFINE( _qualifier, _designator, _name )

Defines an interrupt lock variable.

Do not add a ';' after this macro.

Parameters
_qualifierThe qualifier for the interrupt lock, e.g. static.
_designatorThe designator for the interrupt lock.
_nameThe name for the interrupt lock. It must be a string. The name is only used if profiling is enabled.

◆ rtems_interrupt_lock_destroy

#define rtems_interrupt_lock_destroy (   _lock)    _ISR_lock_Destroy( _lock )

Destroys an interrupt lock.

Concurrent destruction leads to unpredictable results.

Parameters
[in,out]_lockThe interrupt lock control.

◆ rtems_interrupt_lock_initialize

#define rtems_interrupt_lock_initialize (   _lock,
  _name 
)    _ISR_lock_Initialize( _lock, _name )

Initializes an interrupt lock.

Concurrent initialization leads to unpredictable results.

Parameters
[in,out]_lockThe interrupt lock.
[in]_nameThe name for the interrupt lock. This name must be a string persistent throughout the life time of this lock. The name is only used if profiling is enabled.

◆ RTEMS_INTERRUPT_LOCK_INITIALIZER

#define RTEMS_INTERRUPT_LOCK_INITIALIZER (   _name)    ISR_LOCK_INITIALIZER( _name )

Initializer for static initialization of interrupt locks.

Parameters
_nameThe name for the interrupt lock. It must be a string. The name is only used if profiling is enabled.

◆ rtems_interrupt_lock_interrupt_disable

#define rtems_interrupt_lock_interrupt_disable (   _lock_context)    _ISR_lock_ISR_disable( _lock_context )

Disables interrupts on the current processor.

This function can be used in thread and interrupt context.

Parameters
[in,out]_lock_contextThe local interrupt lock context for an acquire and release pair.
See also
rtems_interrupt_lock_acquire_isr().

◆ RTEMS_INTERRUPT_LOCK_MEMBER

#define RTEMS_INTERRUPT_LOCK_MEMBER (   _designator)    ISR_LOCK_MEMBER( _designator )

Defines an interrupt lock member.

Do not add a ';' after this macro.

Parameters
_designatorThe designator for the interrupt lock.

◆ RTEMS_INTERRUPT_LOCK_REFERENCE

#define RTEMS_INTERRUPT_LOCK_REFERENCE (   _designator,
  _target 
)    ISR_LOCK_REFERENCE( _designator, _target )

Defines an interrupt lock variable reference.

Do not add a ';' after this macro.

Parameters
_designatorThe designator for the interrupt lock reference.
_targetThe target for the interrupt lock reference.

◆ rtems_interrupt_lock_release

#define rtems_interrupt_lock_release (   _lock,
  _lock_context 
)    _ISR_lock_Release_and_ISR_enable( _lock, _lock_context )

Releases an interrupt lock.

The interrupt status will be restored. On SMP configurations this function releases an SMP lock.

This function can be used in thread and interrupt context.

Parameters
[in,out]_lockThe interrupt lock.
[in,out]_lock_contextThe local interrupt lock context for an acquire and release pair.
See also
rtems_interrupt_lock_acquire().

◆ rtems_interrupt_lock_release_isr

#define rtems_interrupt_lock_release_isr (   _lock,
  _lock_context 
)    do { (void) _lock_context; } while ( 0 )

Releases an interrupt lock in the corresponding interrupt service routine.

The interrupt status will remain unchanged. On SMP configurations this function releases an SMP lock.

Parameters
[in,out]_lockThe interrupt lock.
[in,out]_lock_contextThe local interrupt lock context for an acquire and release pair.
See also
rtems_interrupt_lock_acquire_isr().