1 #ifndef EVE_PM_H_INCLUDED 2 #define EVE_PM_H_INCLUDED 177 #define PM_LOCK_INIT(l, pm, cb, d) \ 179 .link = DLIST_INIT(pm.link), \ 188 #define PM_LOCK(pm) pm_lock_dbg(&pm, __FILE__, __LINE__) 189 #define PM_UNLOCK(pm) pm_unlock_dbg(&pm, __FILE__, __LINE__) 190 #define PM_AUTO_LOCK(l) \ 191 inline void pm_unlock_dbg_adapter(struct pm_lock_t *pm) { pm_unlock_dbg(pm, __FILE__, __LINE__); } \ 192 struct pm_lock_t EvePmAutoLock __attribute__((cleanup(pm_unlock_dbg_adapter))); \ 193 do { EvePmAutoLock = (struct pm_lock_t) PM_LOCK_INIT(l, EvePmAutoLock, NULL, 0); } while (0) 195 #define PM_LOCK_INIT(l, pm, cb, d) \ 203 #define PM_LOCK(pm) pm_lock(&pm) 204 #define PM_UNLOCK(pm) pm_unlock(&pm) 205 #define PM_AUTO_LOCK(l) \ 206 struct pm_lock_t EvePmAutoLock __attribute__((cleanup(pm_unlock))); \ 207 do { EvePmAutoLock = (struct pm_lock_t) PM_LOCK_INIT(l, EvePmAutoLock, NULL, 0); } while (0) 210 #define DECLARE_PM_LOCK(l, pm, cb, d) \ 211 static struct pm_lock_t pm = PM_LOCK_INIT(l, pm, cb, d) 272 void pm_lock_dbg(
struct pm_lock_t *pm,
const char *file,
int line);
282 void pm_unlock_dbg(
struct pm_lock_t *pm,
const char *file,
int line);
enum pm_level_t pm_waterlevel(void)
The code implements Dummy Headed Doubly Linked Circularlist (DHDLC) primitive.
void pm_lock(struct pm_lock_t *pm)
bool(* ready_cb)(uint32_t data)
void pm_unlock(struct pm_lock_t *pm)