9 struct list tasks
; /* tasks waiting on semaphore */
13 #define SEM_DECLARE_INIT(sname, scount) \
14 struct sem sname = { \
16 .tasks = LIST_INIT(sname.tasks), \
20 void sem_init(struct sem
*sem
, int count
);
21 __attribute__ ((warn_unused_result
)) int down(struct sem
*sem
, u32 timeout
);
22 void up(struct sem
*sem
);
27 struct list tasks
; /* tasks waiting on mutexaphore */
31 void mutex_init(struct mutex
*mutex
, int count
);
32 __attribute__ ((warn_unused_result
)) int mutex_down(struct mutex
*mutex
, u32 timeout
);
33 __attribute__ ((warn_unused_result
)) int mutex_downtry(struct mutex
*mutex
);
34 void mutex_up(struct mutex
*mutex
);