POK(kernelpart)
lockobj.h
Go to the documentation of this file.
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_LOCKOBJ_H__
19 #define __POK_KERNEL_LOCKOBJ_H__
20 
21 #include <types.h>
22 #include <arch.h>
23 
24 #ifndef POK_CONFIG_NB_LOCKOBJECTS
25 #define POK_CONFIG_NB_LOCKOBJECTS 0
26 #endif
27 
28 /*
29  * In POK, all locking objects are implemented in the same way. It avoids
30  * code duplication and save the environnement because we will consume less
31  * space on your disk and will save trees because stupid people that prints
32  * the code will consume less paper.
33  * Moreoever, if all lockobjects share the same code, it will be easy to
34  * certify and verify the behavior of all.
35  */
36 
37 
38 typedef enum
39 {
44 
45 /* All kind of lock objects we have in the kernel */
46 
47 typedef enum
48 {
53 
54 
55 typedef enum
56 {
61 
62 
63 typedef struct
64 {
71 
72 typedef struct
73 {
76  /* spinlock to enfoce mutual exclusion */
77 
79  /* Is the mutex locked ? */
80 
82  /* Describe which thread is blocked in the mutex */
83 
85  /* Locking policy */
86 
88  /* Locking policy */
89 
91 
93  /* Is the mutex initialized ? */
94 
98 
99 
100 typedef enum
101 {
105 
106 typedef enum
107 {
114 
115 typedef struct
116 {
122 
123 
133 
134 #endif