POK(kernelpart)
syscall.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 #ifndef __POK_SYSCALL_H__
18 #define __POK_SYSCALL_H__
19 
20 #include <types.h>
21 #include <errno.h>
22 
23 typedef enum
24 {
38 #ifdef POK_NEEDS_PORTS_SAMPLING
39  POK_SYSCALL_MIDDLEWARE_SAMPLING_ID = 101,
40  POK_SYSCALL_MIDDLEWARE_SAMPLING_READ = 102,
41  POK_SYSCALL_MIDDLEWARE_SAMPLING_STATUS = 103,
42  POK_SYSCALL_MIDDLEWARE_SAMPLING_WRITE = 104,
43  POK_SYSCALL_MIDDLEWARE_SAMPLING_CREATE = 105,
44 #endif
45 #ifdef POK_NEEDS_PORTS_QUEUEING
46  POK_SYSCALL_MIDDLEWARE_QUEUEING_CREATE = 110,
47  POK_SYSCALL_MIDDLEWARE_QUEUEING_SEND = 111,
48  POK_SYSCALL_MIDDLEWARE_QUEUEING_RECEIVE = 112,
49  POK_SYSCALL_MIDDLEWARE_QUEUEING_ID = 113,
50  POK_SYSCALL_MIDDLEWARE_QUEUEING_STATUS = 114,
51 #endif
52 #ifdef POK_NEEDS_PORTS_VIRTUAL
53  POK_SYSCALL_MIDDLEWARE_VIRTUAL_CREATE = 150,
54  POK_SYSCALL_MIDDLEWARE_VIRTUAL_NB_DESTINATIONS = 151,
55  POK_SYSCALL_MIDDLEWARE_VIRTUAL_DESTINATION = 152,
56  POK_SYSCALL_MIDDLEWARE_VIRTUAL_GET_GLOBAL = 153,
57 #endif
58 #if defined (POK_NEEDS_LOCKOBJECTS) || defined (POK_NEEDS_MUTEXES) || defined (POK_NEEDS_SEMAPHORES) || defined (POK_NEEDS_EVENTS) || defined (POK_NEEDS_BUFFERS) || defined (POK_NEEDS_BLACKBOARDS)
59  POK_SYSCALL_LOCKOBJ_CREATE = 201,
60  POK_SYSCALL_LOCKOBJ_OPERATION = 202,
61 #endif
62 #ifdef POK_NEEDS_ERROR_HANDLING
63  POK_SYSCALL_ERROR_HANDLER_CREATE = 301,
64  POK_SYSCALL_ERROR_HANDLER_SET_READY = 302,
65  POK_SYSCALL_ERROR_RAISE_APPLICATION_ERROR = 303,
66  POK_SYSCALL_ERROR_GET = 304,
67 #endif
68 #ifdef POK_NEEDS_PARTITIONS
69  POK_SYSCALL_PARTITION_SET_MODE = 404,
70  POK_SYSCALL_PARTITION_GET_ID = 405,
71  POK_SYSCALL_PARTITION_GET_PERIOD = 406,
72  POK_SYSCALL_PARTITION_GET_DURATION = 407,
73  POK_SYSCALL_PARTITION_GET_LOCK_LEVEL = 408,
74  POK_SYSCALL_PARTITION_GET_OPERATING_MODE = 409,
75  POK_SYSCALL_PARTITION_GET_START_CONDITION = 410,
76 #endif
77 #ifdef POK_NEEDS_IO
78  POK_SYSCALL_INB = 501,
79  POK_SYSCALL_OUTB = 502,
80 #endif
81 #ifdef POK_NEEDS_PCI
82  POK_SYSCALL_PCI_REGISTER = 601,
83 #endif
85 
86 typedef struct
87 {
95 
96 typedef struct
97 {
102 
103 
104 
127  const pok_syscall_args_t* args,
128  const pok_syscall_info_t* infos);
129 
130 /*
131  * Initiate syscalls.
132  * This part is defined in low-level layers, each architecture/bsp
133  * initiate the syscall in a different way.
134  */
136 
137 #define POK_CHECK_PTR_OR_RETURN(pid,ptr) \
138  if (!POK_CHECK_PTR_IN_PARTITION(pid,ptr)) \
139 { \
140  return POK_ERRNO_EINVAL; \
141 }
142 
143 #endif /* __POK_SYSCALL_H__ */