POK
semaphore.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifndef __POK_KERNEL_SEMAPHORE_H__
19 #define __POK_KERNEL_SEMAPHORE_H__
20 
21 #include <core/dependencies.h>
22 
23 #ifdef POK_NEEDS_SEMAPHORES
24 
25 #include <types.h>
26 #include <errno.h>
27 
28 
29 #define POK_SEMAPHORE_DISCIPLINE_FIFO 1
30 
31 
32 pok_ret_t pok_sem_create (pok_sem_id_t* id,
33  const pok_sem_value_t current_value,
34  const pok_sem_value_t max_value,
35  const pok_queueing_discipline_t discipline);
36 
37 pok_ret_t pok_sem_wait (pok_sem_id_t id,
38  uint64_t timeout);
39 
40 pok_ret_t pok_sem_signal (pok_sem_id_t id);
41 
42 pok_ret_t pok_sem_id (char* name,
43  pok_sem_id_t* id);
44 
45 pok_ret_t pok_sem_status (pok_sem_id_t id,
46  pok_sem_status_t* status);
47 
48 
49 #endif
50 
51 #endif