coverity appeasement - redundant check
[minix.git] / kernel / system.h
blob19285a176d2ff8438d52c2dba9ae2bb373d521e7
1 /* Function prototypes for the system library. The prototypes in this file
2 * are undefined to NULL if the kernel call is not enabled in config.h.
3 * The implementation is contained in src/kernel/system/.
5 * The system library allows to access system services by doing a kernel call.
6 * System calls are transformed into request messages to the SYS task that is
7 * responsible for handling the call. By convention, sys_call() is transformed
8 * into a message with type SYS_CALL that is handled in a function do_call().
9 *
10 * Changes:
11 * Mar 01, 2010 SYS_CLEAR and SYS_EXIT split (Cristiano Giuffrida)
12 * Jul 30, 2005 created SYS_INT86 to support BIOS driver (Philip Homburg)
13 * Jul 13, 2005 created SYS_PRIVCTL to manage services (Jorrit N. Herder)
14 * Jul 09, 2005 updated SYS_KILL to signal services (Jorrit N. Herder)
15 * Jun 21, 2005 created SYS_NICE for nice(2) kernel call (Ben J. Gras)
16 * Jun 21, 2005 created SYS_MEMSET to speed up exec(2) (Ben J. Gras)
17 * Jan 20, 2005 updated SYS_COPY for virtual_copy() (Jorrit N. Herder)
18 * Oct 24, 2004 created SYS_GETKSIG to support PM (Jorrit N. Herder)
19 * Oct 10, 2004 created handler for unused calls (Jorrit N. Herder)
20 * Sep 09, 2004 updated SYS_EXIT to let services exit (Jorrit N. Herder)
21 * Aug 25, 2004 rewrote SYS_SETALARM to clean up code (Jorrit N. Herder)
22 * Jul 13, 2004 created SYS_SEGCTL to support drivers (Jorrit N. Herder)
23 * May 24, 2004 created SYS_SDEVIO to support drivers (Jorrit N. Herder)
24 * May 24, 2004 created SYS_GETINFO to retrieve info (Jorrit N. Herder)
25 * Apr 18, 2004 created SYS_VDEVIO to support drivers (Jorrit N. Herder)
26 * Feb 24, 2004 created SYS_IRQCTL to support drivers (Jorrit N. Herder)
27 * Feb 02, 2004 created SYS_DEVIO to support drivers (Jorrit N. Herder)
28 */
30 #ifndef SYSTEM_H
31 #define SYSTEM_H
33 #include "kernel.h"
35 int do_exec(struct proc * caller, message *m_ptr);
36 #if ! USE_EXEC
37 #define do_exec NULL
38 #endif
40 int do_fork(struct proc * caller, message *m_ptr);
41 #if ! USE_FORK
42 #define do_fork NULL
43 #endif
45 int do_clear(struct proc * caller, message *m_ptr);
46 #if ! USE_CLEAR
47 #define do_clear NULL
48 #endif
50 int do_trace(struct proc * caller, message *m_ptr);
51 #if ! USE_TRACE
52 #define do_trace NULL
53 #endif
55 int do_runctl(struct proc * caller, message *m_ptr);
56 #if ! USE_RUNCTL
57 #define do_runctl NULL
58 #endif
60 int do_update(struct proc * caller, message *m_ptr);
61 #if ! USE_UPDATE
62 #define do_update NULL
63 #endif
65 int do_exit(struct proc * caller, message *m_ptr);
66 #if ! USE_EXIT
67 #define do_exit NULL
68 #endif
70 int do_copy(struct proc * caller, message *m_ptr);
71 #define do_vircopy do_copy
72 #if ! (USE_VIRCOPY || USE_PHYSCOPY)
73 #define do_copy NULL
74 #endif
76 int do_umap(struct proc * caller, message *m_ptr);
77 #if ! USE_UMAP
78 #define do_umap NULL
79 #endif
81 int do_umap_remote(struct proc * caller, message *m_ptr);
82 #if ! USE_UMAP_REMOTE
83 #define do_umap_remote NULL
84 #endif
86 int do_vumap(struct proc * caller, message *m_ptr);
87 #if ! USE_VUMAP
88 #define do_vumap NULL
89 #endif
91 int do_memset(struct proc * caller, message *m_ptr);
92 #if ! USE_MEMSET
93 #define do_memset NULL
94 #endif
96 int do_abort(struct proc * caller, message *m_ptr);
97 #if ! USE_ABORT
98 #define do_abort NULL
99 #endif
101 int do_getinfo(struct proc * caller, message *m_ptr);
102 #if ! USE_GETINFO
103 #define do_getinfo NULL
104 #endif
106 int do_privctl(struct proc * caller, message *m_ptr);
107 #if ! USE_PRIVCTL
108 #define do_privctl NULL
109 #endif
111 int do_irqctl(struct proc * caller, message *m_ptr);
112 #if ! USE_IRQCTL
113 #define do_irqctl NULL
114 #endif
116 int do_devio(struct proc * caller, message *m_ptr);
117 #if ! USE_DEVIO
118 #define do_devio NULL
119 #endif
121 int do_vdevio(struct proc * caller, message *m_ptr);
122 #if ! USE_VDEVIO
123 #define do_vdevio NULL
124 #endif
126 int do_sdevio(struct proc * caller, message *m_ptr);
127 #if ! USE_SDEVIO
128 #define do_sdevio NULL
129 #endif
131 int do_kill(struct proc * caller, message *m_ptr);
132 #if ! USE_KILL
133 #define do_kill NULL
134 #endif
136 int do_getksig(struct proc * caller, message *m_ptr);
137 #if ! USE_GETKSIG
138 #define do_getksig NULL
139 #endif
141 int do_endksig(struct proc * caller, message *m_ptr);
142 #if ! USE_ENDKSIG
143 #define do_endksig NULL
144 #endif
146 int do_sigsend(struct proc * caller, message *m_ptr);
147 #if ! USE_SIGSEND
148 #define do_sigsend NULL
149 #endif
151 int do_sigreturn(struct proc * caller, message *m_ptr);
152 #if ! USE_SIGRETURN
153 #define do_sigreturn NULL
154 #endif
156 int do_times(struct proc * caller, message *m_ptr);
157 #if ! USE_TIMES
158 #define do_times NULL
159 #endif
161 int do_setalarm(struct proc * caller, message *m_ptr);
162 #if ! USE_SETALARM
163 #define do_setalarm NULL
164 #endif
166 int do_stime(struct proc * caller, message *m_ptr);
168 int do_vtimer(struct proc * caller, message *m_ptr);
169 #if ! USE_VTIMER
170 #define do_vtimer NULL
171 #endif
173 int do_safecopy_to(struct proc * caller, message *m_ptr);
174 int do_safecopy_from(struct proc * caller, message *m_ptr);
175 int do_vsafecopy(struct proc * caller, message *m_ptr);
176 int do_iopenable(struct proc * caller, message *m_ptr);
177 int do_vmctl(struct proc * caller, message *m_ptr);
178 int do_setgrant(struct proc * caller, message *m_ptr);
179 int do_readbios(struct proc * caller, message *m_ptr);
181 int do_safemap(struct proc * caller, message *m_ptr);
182 int do_saferevmap(struct proc * caller, message *m_ptr);
183 int do_safeunmap(struct proc * caller, message *m_ptr);
185 int do_sprofile(struct proc * caller, message *m_ptr);
186 #if ! SPROFILE
187 #define do_sprofile NULL
188 #endif
190 int do_cprofile(struct proc * caller, message *m_ptr);
191 int do_profbuf(struct proc * caller, message *m_ptr);
192 #if ! CPROFILE
193 #define do_cprofile NULL
194 #define do_profbuf NULL
195 #endif
197 int do_getmcontext(struct proc * caller, message *m_ptr);
198 int do_setmcontext(struct proc * caller, message *m_ptr);
199 #if ! USE_MCONTEXT
200 #define do_getmcontext NULL
201 #define do_setmcontext NULL
202 #endif
204 int do_schedule(struct proc * caller, message *m_ptr);
205 int do_schedctl(struct proc * caller, message *m_ptr);
207 int do_statectl(struct proc * caller, message *m_ptr);
208 #if ! USE_STATECTL
209 #define do_statectl NULL
210 #endif
212 #endif /* SYSTEM_H */