hexo/lock.h header reference
[Hardware abstraction layer module]
The source code of this header can be browsed online.
Description [link]
Spinlock operations include memory barriers to ensure the consistency of memory accesses on weakly-ordered memory architectures.
Members [link]
Types [link]
- struct lock_irq_s
- typedef [...] lock_irq_t
- struct lock_s
- typedef [...] lock_t
- struct lock_irq_scoped_s
- struct lock_scoped_s
Functions [link]
- void lock_destroy(lock_t *lock)
- void lock_destroy_irq(lock_irq_t *lock)
- error_t lock_init(lock_t *lock)
- error_t lock_init_irq(lock_irq_t *lock)
- void lock_release(lock_t *lock)
- void lock_release_irq(lock_irq_t *lock)
- void lock_release_irq2(lock_t *lock, const cpu_irq_state_t *irq_state)
- void lock_spin(lock_t *lock)
- void lock_spin_irq(lock_irq_t *lock)
- void lock_spin_irq2(lock_t *lock, cpu_irq_state_t *irq_state)
- bool_t lock_try(lock_t *lock)
- void lock_irq_scoped_release(struct lock_irq_scoped_s *ls)
- void lock_irq_scoped_spin(struct lock_irq_scoped_s *ls, lock_t *lock)
- void lock_scoped_release(struct lock_scoped_s *ls)
- void lock_scoped_spin(struct lock_scoped_s *ls, lock_t *lock)
Macros [link]
Members detail [link]
#define LOCK_H_ [link]
This macro is declared in hexo/lock.h source file, line 32.
#define LOCK_INITIALIZER [link]
This macro is declared in hexo/lock.h source file, line 71.
Preprocessor condition: defined( CONFIG_ARCH_SMP ) or defined( CONFIG_HEXO_LOCK_DEBUG )
#define LOCK_INITIALIZER [link]
This macro is declared in hexo/lock.h source file, line 73.
Preprocessor condition: not ( defined( CONFIG_ARCH_SMP ) or defined( CONFIG_HEXO_LOCK_DEBUG ))
#define LOCK_RELEASE_IRQ(lock) [link]
This macro is declared in hexo/lock.h source file, line 228.
this macro releases a lock and restore previous interrupts state. This macro must be matched with the LOCK_SPIN_IRQ macro.
Alternate declarations with same identifier: [1], [2].
Preprocessor condition: defined( CONFIG_HEXO_IRQ )
#define LOCK_RELEASE_IRQ(lock) [link]
This macro is declared in hexo/lock.h source file, line 234.
this macro releases a lock and restore previous interrupts state. This macro must be matched with the LOCK_SPIN_IRQ macro.
Alternate declarations with same identifier: [1], [2].
Preprocessor condition: not defined( CONFIG_HEXO_IRQ )
#define LOCK_SPIN_IRQ(lock) [link]
This macro is declared in hexo/lock.h source file, line 175.
this macro saves interrupts state, disables interrupts, and spins to take lock. This macro must be matched with the LOCK_RELEASE_IRQ macro. Using #LOCK_SPIN_IRQ_SCOPED is preferred over using this macros.
Alternate declarations with same identifier: [1], [2].
Preprocessor condition: defined( CONFIG_HEXO_IRQ )
#define LOCK_SPIN_IRQ(lock) [link]
This macro is declared in hexo/lock.h source file, line 181.
Documentation from alternate declaration:
this macro saves interrupts state, disables interrupts, and spins to take lock. This macro must be matched with the LOCK_RELEASE_IRQ macro. Using #LOCK_SPIN_IRQ_SCOPED is preferred over using this macros.
Alternate declarations with same identifier: [1], [2].
Preprocessor condition: not defined( CONFIG_HEXO_IRQ )
#define LOCK_SPIN_IRQ_SCOPED(lock) [link]
This macro is declared in hexo/lock.h source file, line 274.
this macro saves interrupts state, disables interrupts, and spins to spin lock. Lock is automatically released when control reaches scope end.
#define LOCK_SPIN_SCOPED(lock) [link]
This macro is declared in hexo/lock.h source file, line 303.
this macro saves interrupts state, disables interrupts, and spins to spin lock. Lock is automatically released when control reaches scope end.
This function is declared in hexo/lock.h source file, line 100.
this function frees lock ressources
void lock_destroy_irq(lock_irq_t *lock) [link]
This function is declared in hexo/lock.h source file, line 108.
this function frees lock ressources
This function is declared in hexo/lock.h source file, line 79.
allocate a new lock
error_t lock_init_irq(lock_irq_t *lock) [link]
This function is declared in hexo/lock.h source file, line 89.
allocate a new lock with interrupt state
struct lock_irq_s [link]
This struct is declared in hexo/lock.h source file, line 59.
Field | Description |
---|---|
cpu_irq_state_t __interrupt_state; | |
struct __arch_lock_s arch; | architecture specific lock data |
See also lock_irq_t.
typedef struct lock_irq_s lock_irq_t [link]
This typedef is declared in hexo/lock.h source file, line 69.
This function is declared in hexo/lock.h source file, line 189.
this function releases a lock
void lock_release_irq(lock_irq_t *lock) [link]
This function is declared in hexo/lock.h source file, line 198.
This function releases a lock and restore previous interrupt state
This function is declared in hexo/lock.h source file, line 213.
This function releases a lock and restore interrupt state from *irq_state
struct lock_s [link]
This struct is declared in hexo/lock.h source file, line 49.
Field | Description |
---|---|
struct __arch_lock_s arch; | architecture specific lock data |
See also lock_t.
This function is declared in hexo/lock.h source file, line 129.
this function spins to take the lock
void lock_spin_irq(lock_irq_t *lock) [link]
This function is declared in hexo/lock.h source file, line 139.
This function disables interrupts, spins to take the lock and store the previous irq state in *lock
This function is declared in hexo/lock.h source file, line 156.
This function disables interrupts, spins to take the lock and store the previous irq state in *irq_state
This typedef is declared in hexo/lock.h source file, line 56.
See also pthread_spinlock_t.
This function is declared in hexo/lock.h source file, line 117.
this function tries to take lock
void lock_irq_scoped_release(struct lock_irq_scoped_s *ls) [link]
This function is declared in hexo/lock.h source file, line 254.
This function is for internal use only.
See also LOCK_SPIN_IRQ_SCOPED.
struct lock_irq_scoped_s [link]
This struct is declared in hexo/lock.h source file, line 244.
This struct is for internal use only.
See also LOCK_SPIN_IRQ_SCOPED.
Field | Description |
---|---|
cpu_irq_state_t interrupt_state; | |
lock_t * lock; |
void lock_irq_scoped_spin(struct lock_irq_scoped_s *ls, lock_t *lock) [link]
This function is declared in hexo/lock.h source file, line 264.
This function is for internal use only.
See also LOCK_SPIN_IRQ_SCOPED.
void lock_scoped_release(struct lock_scoped_s *ls) [link]
This function is declared in hexo/lock.h source file, line 289.
This function is for internal use only.
See also LOCK_SPIN_SCOPED.
struct lock_scoped_s [link]
This struct is declared in hexo/lock.h source file, line 282.
This struct is for internal use only.
See also LOCK_SPIN_SCOPED.
void lock_scoped_spin(struct lock_scoped_s *ls, lock_t *lock) [link]
This function is declared in hexo/lock.h source file, line 296.
This function is for internal use only.
See also LOCK_SPIN_SCOPED.