7#ifndef _PICO_LOCK_CORE_H
8#define _PICO_LOCK_CORE_H
42#ifndef PARAM_ASSERTIONS_ENABLED_LOCK_CORE
43#define PARAM_ASSERTIONS_ENABLED_LOCK_CORE 0
72void lock_init(lock_core_t *core, uint lock_num);
74#ifndef lock_owner_id_t
81#define lock_owner_id_t int8_t
84#ifndef LOCK_INVALID_OWNER_ID
88#define LOCK_INVALID_OWNER_ID ((lock_owner_id_t)-1)
91#ifndef lock_get_caller_owner_id
97#define lock_get_caller_owner_id() ((lock_owner_id_t)get_core_num())
98#ifndef lock_is_owner_id_valid
99#define lock_is_owner_id_valid(id) ((id)>=0)
103#ifndef lock_is_owner_id_valid
104#define lock_is_owner_id_valid(id) ((id) != LOCK_INVALID_OWNER_ID)
107#ifndef lock_internal_spin_unlock_with_wait
128#define lock_internal_spin_unlock_with_wait(lock, save) spin_unlock((lock)->spin_lock, save), __wfe()
131#ifndef lock_internal_spin_unlock_with_notify
151#define lock_internal_spin_unlock_with_notify(lock, save) spin_unlock((lock)->spin_lock, save), __sev()
154#ifndef lock_internal_spin_unlock_with_best_effort_wait_or_timeout
177#define lock_internal_spin_unlock_with_best_effort_wait_or_timeout(lock, save, until) ({ \
178 spin_unlock((lock)->spin_lock, save); \
179 best_effort_wfe_or_timeout(until); \
183#ifndef sync_internal_yield_until_before
196#define sync_internal_yield_until_before(until) ((void)0)
io_rw_32 spin_lock_t
A spin lock identifier.
Definition spin_lock.h:84
void lock_init(lock_core_t *core, uint lock_num)
Initialise a lock structure.
Definition lock_core.c:9
Definition lock_core.h:53