17 #include <core/dependencies.h>
19 #ifdef POK_NEEDS_SEMAPHORES
22 #include <core/semaphore.h>
23 #include <core/lockobj.h>
24 #include <core/syscall.h>
26 pok_ret_t pok_sem_create (pok_sem_id_t*
id,
27 const pok_sem_value_t current_value,
28 const pok_sem_value_t max_value,
29 const pok_queueing_discipline_t discipline)
32 lockattr.initial_value = current_value;
33 lockattr.max_value = max_value;
34 lockattr.queueing_policy = discipline;
35 lockattr.kind = POK_LOCKOBJ_KIND_SEMAPHORE;
37 return pok_syscall2 (POK_SYSCALL_LOCKOBJ_CREATE, (uint32_t)
id, (uint32_t)&lockattr);