RTEMS
5.0.0
|
Low-level lock to protect critical sections accessed by threads and interrupt service routines. More...
Files | |
file | isrlock.h |
ISR Locks. | |
Data Structures | |
struct | ISR_lock_Control |
ISR lock control. More... | |
struct | ISR_lock_Context |
Local ISR lock context for acquire and release pairs. More... | |
Macros | |
#define | ISR_LOCK_MEMBER(_designator) |
Defines an ISR lock member. More... | |
#define | ISR_LOCK_DECLARE(_qualifier, _designator) |
Declares an ISR lock variable. More... | |
#define | ISR_LOCK_DEFINE(_qualifier, _designator, _name) |
Defines an ISR lock variable. More... | |
#define | ISR_LOCK_REFERENCE(_designator, _target) |
Defines an ISR lock variable reference. More... | |
#define | ISR_LOCK_INITIALIZER(_name) { } |
Initializer for static initialization of ISR locks. More... | |
#define | _ISR_lock_Initialize(_lock, _name) |
Initializes an ISR lock. More... | |
#define | _ISR_lock_Destroy(_lock) |
Destroys an ISR lock. More... | |
#define | _ISR_lock_ISR_disable_and_acquire(_lock, _context) _ISR_Local_disable( ( _context )->isr_level ) |
Acquires an ISR lock. More... | |
#define | _ISR_lock_Release_and_ISR_enable(_lock, _context) _ISR_Local_enable( ( _context )->isr_level ) |
Releases an ISR lock. More... | |
#define | _ISR_lock_Acquire(_lock, _context) do { (void) _context; } while ( 0 ) |
Acquires an ISR lock inside an ISR disabled section. More... | |
#define | _ISR_lock_Release(_lock, _context) do { (void) _context; } while ( 0 ) |
Releases an ISR lock inside an ISR disabled section. More... | |
#define | _ISR_lock_Acquire_inline(_lock, _context) do { (void) _context; } while ( 0 ) |
Acquires an ISR lock inside an ISR disabled section (inline). More... | |
#define | _ISR_lock_Release_inline(_lock, _context) do { (void) _context; } while ( 0 ) |
Releases an ISR lock inside an ISR disabled section (inline). More... | |
#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. More... | |
#define | _ISR_lock_ISR_enable(_context) _ISR_Local_enable( ( _context )->isr_level ) |
Restores the saved interrupt state of the ISR lock context. More... | |
Functions | |
RTEMS_INLINE_ROUTINE void | _ISR_lock_Context_set_level (ISR_lock_Context *context, ISR_Level level) |
Sets the ISR level in the ISR lock context. More... | |
Low-level lock to protect critical sections accessed by threads and interrupt service routines.
On single processor configurations the ISR locks degrade to simple ISR disable/enable sequences. No additional storage or objects are required.
This synchronization primitive is supported on SMP configurations. Here SMP locks are used.
#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.
[in] | _lock | The ISR lock control. |
[in] | _context | The local ISR lock context for an acquire and release pair. |
#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_Destroy | ( | _lock | ) |
Destroys an ISR lock.
Concurrent destruction leads to unpredictable results.
[in] | _lock | The ISR lock control. |
#define _ISR_lock_Initialize | ( | _lock, | |
_name | |||
) |
Initializes an ISR lock.
Concurrent initialization leads to unpredictable results.
[in] | _lock | The ISR lock control. |
[in] | _name | The 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. |
#define _ISR_lock_ISR_disable | ( | _context | ) |
Disables interrupts and saves the previous interrupt state in the ISR lock context.
This function can be used in thread and interrupt context.
[in] | _context | The local ISR lock context to store the interrupt state. |
#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.
[in] | _lock | The ISR lock control. |
[in] | _context | The local ISR lock context for an acquire and release pair. |
#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.
[in] | _context | The local ISR lock context containing the saved interrupt state. |
#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.
[in] | _lock | The ISR lock control. |
[in] | _context | The local ISR lock context for an acquire and release pair. |
#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.
[in] | _lock | The ISR lock control. |
[in] | _context | The local ISR lock context for an acquire and release pair. |
#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_DECLARE | ( | _qualifier, | |
_designator | |||
) |
Declares an ISR lock variable.
Do not add a ';' after this macro.
_qualifier | The qualifier for the interrupt lock, e.g. extern. |
_designator | The designator for the interrupt lock. |
#define ISR_LOCK_DEFINE | ( | _qualifier, | |
_designator, | |||
_name | |||
) |
Defines an ISR lock variable.
Do not add a ';' after this macro.
_qualifier | The qualifier for the interrupt lock, e.g. static. |
_designator | The designator for the interrupt lock. |
_name | The name for the interrupt lock. It must be a string. The name is only used if profiling is enabled. |
#define ISR_LOCK_INITIALIZER | ( | _name | ) | { } |
Initializer for static initialization of ISR locks.
_name | The name for the interrupt lock. It must be a string. The name is only used if profiling is enabled. |
#define ISR_LOCK_MEMBER | ( | _designator | ) |
Defines an ISR lock member.
Do not add a ';' after this macro.
_designator | The designator for the interrupt lock. |
#define ISR_LOCK_REFERENCE | ( | _designator, | |
_target | |||
) |
Defines an ISR lock variable reference.
Do not add a ';' after this macro.
_designator | The designator for the interrupt lock reference. |
_target | The target for the interrupt lock reference. |
RTEMS_INLINE_ROUTINE void _ISR_lock_Context_set_level | ( | ISR_lock_Context * | context, |
ISR_Level | level | ||
) |
Sets the ISR level in the ISR lock context.
[in] | context | The ISR lock context. |
[in] | level | The ISR level. |