RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Files | Data Structures | Macros

This group contains the ISR locks implementation. More...

Files

file  isrlock.h
 This header file provides the interfaces of the ISR Locks.
 

Data Structures

struct  ISR_lock_Context
 Local ISR lock context for acquire and release pairs. More...
 

Macros

#define ISR_LOCK_NEEDS_OBJECT   0
 If this define has a non-zero value, then the interrupt lock operations require an object of type ::ISR_lock_Control, otherwise no lock object is required.
 
#define _ISR_lock_Initialize(_lock, _name)    do { (void) _name; } while (0)
 Initializes an ISR lock.
 
#define _ISR_lock_Destroy(_lock)
 Destroys an ISR lock.
 
#define _ISR_lock_Set_name(_lock, _name)
 Sets the name of an ISR lock.
 
#define _ISR_lock_ISR_disable_and_acquire(_lock, _context)    _ISR_Local_disable( ( _context )->isr_level )
 Acquires an ISR lock.
 
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)    _ISR_Local_enable( ( _context )->isr_level )
 Releases an ISR lock.
 
#define _ISR_lock_Acquire(_lock, _context)    do { (void) _context; } while ( 0 )
 Acquires an ISR lock inside an ISR disabled section.
 
#define _ISR_lock_Release(_lock, _context)    do { (void) _context; } while ( 0 )
 Releases an ISR lock inside an ISR disabled section.
 
#define _ISR_lock_Acquire_inline(_lock, _context)    do { (void) _context; } while ( 0 )
 Acquires an ISR lock inside an ISR disabled section (inline).
 
#define _ISR_lock_Release_inline(_lock, _context)    do { (void) _context; } while ( 0 )
 Releases an ISR lock inside an ISR disabled section (inline).
 
#define _ISR_lock_ISR_disable_profile(_context)
 
#define _ISR_lock_ISR_disable(_context)
 Disables interrupts and saves the previous interrupt state in the ISR lock context.
 
#define _ISR_lock_ISR_enable(_context)    _ISR_Local_enable( ( _context )->isr_level )
 Restores the saved interrupt state of the ISR lock context.
 

Detailed Description

This group contains the ISR locks implementation.

The ISR locks are low-level locks to protect critical sections accessed by threads and interrupt service routines.

In uniprocessor configurations the ISR locks degrade to simple ISR disable/enable sequences. No additional storage or objects are required.

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

Macro Definition Documentation

◆ _ISR_lock_Acquire

#define _ISR_lock_Acquire (   _lock,
  _context 
)     do { (void) _context; } while ( 0 )

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.

Parameters
[in]_lockThe ISR lock control.
[in]_contextThe local ISR lock context for an acquire and release pair.
See also
_ISR_lock_Release().

◆ _ISR_lock_Acquire_inline

#define _ISR_lock_Acquire_inline (   _lock,
  _context 
)     do { (void) _context; } while ( 0 )

Acquires an ISR lock inside an ISR disabled section (inline).

See also
_ISR_lock_Acquire().

◆ _ISR_lock_Destroy

#define _ISR_lock_Destroy (   _lock)

Destroys an ISR lock.

Concurrent destruction leads to unpredictable results.

Parameters
[in]_lockThe ISR lock control.

◆ _ISR_lock_Initialize

#define _ISR_lock_Initialize (   _lock,
  _name 
)     do { (void) _name; } while (0)

Initializes an ISR lock.

Concurrent initialization leads to unpredictable results.

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

◆ _ISR_lock_ISR_disable

#define _ISR_lock_ISR_disable (   _context)
Value:
do { \
_ISR_Local_disable( ( _context )->isr_level ); \
_ISR_lock_ISR_disable_profile( _context ) \
} while ( 0 )

Disables interrupts and saves the previous interrupt state in the ISR lock context.

This function can be used in thread and interrupt context.

Parameters
[in]_contextThe local ISR lock context to store the interrupt state.
See also
_ISR_lock_ISR_enable().

◆ _ISR_lock_ISR_disable_and_acquire

#define _ISR_lock_ISR_disable_and_acquire (   _lock,
  _context 
)     _ISR_Local_disable( ( _context )->isr_level )

Acquires an ISR 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]_lockThe ISR lock control.
[in]_contextThe local ISR lock context for an acquire and release pair.
See also
_ISR_lock_Release_and_ISR_enable().

◆ _ISR_lock_ISR_enable

#define _ISR_lock_ISR_enable (   _context)     _ISR_Local_enable( ( _context )->isr_level )

Restores the saved interrupt state of the ISR lock context.

This function can be used in thread and interrupt context.

Parameters
[in]_contextThe local ISR lock context containing the saved interrupt state.
See also
_ISR_lock_ISR_disable().

◆ _ISR_lock_Release

#define _ISR_lock_Release (   _lock,
  _context 
)     do { (void) _context; } while ( 0 )

Releases an ISR lock inside an ISR disabled section.

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

Parameters
[in]_lockThe ISR lock control.
[in]_contextThe local ISR lock context for an acquire and release pair.
See also
_ISR_lock_Acquire().

◆ _ISR_lock_Release_and_ISR_enable

#define _ISR_lock_Release_and_ISR_enable (   _lock,
  _context 
)     _ISR_Local_enable( ( _context )->isr_level )

Releases an ISR 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]_lockThe ISR lock control.
[in]_contextThe local ISR lock context for an acquire and release pair.
See also
_ISR_lock_ISR_disable_and_acquire().

◆ _ISR_lock_Release_inline

#define _ISR_lock_Release_inline (   _lock,
  _context 
)     do { (void) _context; } while ( 0 )

Releases an ISR lock inside an ISR disabled section (inline).

See also
_ISR_lock_Release().

◆ _ISR_lock_Set_name

#define _ISR_lock_Set_name (   _lock,
  _name 
)

Sets the name of an ISR lock.

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

◆ ISR_LOCK_NEEDS_OBJECT

#define ISR_LOCK_NEEDS_OBJECT   0

If this define has a non-zero value, then the interrupt lock operations require an object of type ::ISR_lock_Control, otherwise no lock object is required.

Notes
This indication can be used to avoid the space overhead for lock objects when they are not needed. In this case, the lock operations will not use a lock objects parameter.