3.1.7 branch.
[minix.git] / kernel / system.h
blob2b589c4b631abbd695e5db4d4e15b32c8bd5c1b6
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 /* Common includes for the system library. */
34 #include "debug.h"
35 #include "kernel.h"
36 #include "proto.h"
37 #include "proc.h"
39 _PROTOTYPE( int do_exec, (struct proc * caller, message *m_ptr) );
40 #if ! USE_EXEC
41 #define do_exec NULL
42 #endif
44 _PROTOTYPE( int do_fork, (struct proc * caller, message *m_ptr) );
45 #if ! USE_FORK
46 #define do_fork NULL
47 #endif
49 _PROTOTYPE( int do_newmap, (struct proc * caller, message *m_ptr) );
50 #if ! USE_NEWMAP
51 #define do_newmap NULL
52 #endif
54 _PROTOTYPE( int do_clear, (struct proc * caller, message *m_ptr) );
55 #if ! USE_CLEAR
56 #define do_clear NULL
57 #endif
59 _PROTOTYPE( int do_trace, (struct proc * caller, message *m_ptr) );
60 #if ! USE_TRACE
61 #define do_trace NULL
62 #endif
64 _PROTOTYPE( int do_runctl, (struct proc * caller, message *m_ptr) );
65 #if ! USE_RUNCTL
66 #define do_runctl NULL
67 #endif
69 _PROTOTYPE( int do_update, (struct proc * caller, message *m_ptr) );
70 #if ! USE_UPDATE
71 #define do_update NULL
72 #endif
74 _PROTOTYPE( int do_exit, (struct proc * caller, message *m_ptr) );
75 #if ! USE_EXIT
76 #define do_exit NULL
77 #endif
79 _PROTOTYPE( int do_copy, (struct proc * caller, message *m_ptr) );
80 #define do_vircopy do_copy
81 #if ! (USE_VIRCOPY || USE_PHYSCOPY)
82 #define do_copy NULL
83 #endif
85 _PROTOTYPE( int do_umap, (struct proc * caller, message *m_ptr) );
86 #if ! USE_UMAP
87 #define do_umap NULL
88 #endif
90 _PROTOTYPE( int do_memset, (struct proc * caller, message *m_ptr) );
91 #if ! USE_MEMSET
92 #define do_memset NULL
93 #endif
95 _PROTOTYPE( int do_abort, (struct proc * caller, message *m_ptr) );
96 #if ! USE_ABORT
97 #define do_abort NULL
98 #endif
100 _PROTOTYPE( int do_getinfo, (struct proc * caller, message *m_ptr) );
101 #if ! USE_GETINFO
102 #define do_getinfo NULL
103 #endif
105 _PROTOTYPE( int do_privctl, (struct proc * caller, message *m_ptr) );
106 #if ! USE_PRIVCTL
107 #define do_privctl NULL
108 #endif
110 _PROTOTYPE( int do_segctl, (struct proc * caller, message *m_ptr) );
111 #if ! USE_SEGCTL
112 #define do_segctl NULL
113 #endif
115 _PROTOTYPE( int do_irqctl, (struct proc * caller, message *m_ptr) );
116 #if ! USE_IRQCTL
117 #define do_irqctl NULL
118 #endif
120 _PROTOTYPE( int do_devio, (struct proc * caller, message *m_ptr) );
121 #if ! USE_DEVIO
122 #define do_devio NULL
123 #endif
125 _PROTOTYPE( int do_vdevio, (struct proc * caller, message *m_ptr) );
126 #if ! USE_VDEVIO
127 #define do_vdevio NULL
128 #endif
130 _PROTOTYPE( int do_int86, (struct proc * caller, message *m_ptr) );
132 _PROTOTYPE( int do_sdevio, (struct proc * caller, message *m_ptr) );
133 #if ! USE_SDEVIO
134 #define do_sdevio NULL
135 #endif
137 _PROTOTYPE( int do_kill, (struct proc * caller, message *m_ptr) );
138 #if ! USE_KILL
139 #define do_kill NULL
140 #endif
142 _PROTOTYPE( int do_getksig, (struct proc * caller, message *m_ptr) );
143 #if ! USE_GETKSIG
144 #define do_getksig NULL
145 #endif
147 _PROTOTYPE( int do_endksig, (struct proc * caller, message *m_ptr) );
148 #if ! USE_ENDKSIG
149 #define do_endksig NULL
150 #endif
152 _PROTOTYPE( int do_sigsend, (struct proc * caller, message *m_ptr) );
153 #if ! USE_SIGSEND
154 #define do_sigsend NULL
155 #endif
157 _PROTOTYPE( int do_sigreturn, (struct proc * caller, message *m_ptr) );
158 #if ! USE_SIGRETURN
159 #define do_sigreturn NULL
160 #endif
162 _PROTOTYPE( int do_times, (struct proc * caller, message *m_ptr) );
163 #if ! USE_TIMES
164 #define do_times NULL
165 #endif
167 _PROTOTYPE( int do_setalarm, (struct proc * caller, message *m_ptr) );
168 #if ! USE_SETALARM
169 #define do_setalarm NULL
170 #endif
172 _PROTOTYPE( int do_stime, (struct proc * caller, message *m_ptr) );
174 _PROTOTYPE( int do_vtimer, (struct proc * caller, message *m_ptr) );
175 #if ! USE_VTIMER
176 #define do_vtimer NULL
177 #endif
179 _PROTOTYPE( int do_safecopy_to, (struct proc * caller, message *m_ptr) );
180 _PROTOTYPE( int do_safecopy_from, (struct proc * caller, message *m_ptr) );
181 _PROTOTYPE( int do_vsafecopy, (struct proc * caller, message *m_ptr) );
182 _PROTOTYPE( int do_iopenable, (struct proc * caller, message *m_ptr) );
183 _PROTOTYPE( int do_vmctl, (struct proc * caller, message *m_ptr) );
184 _PROTOTYPE( int do_setgrant, (struct proc * caller, message *m_ptr) );
185 _PROTOTYPE( int do_readbios, (struct proc * caller, message *m_ptr) );
187 _PROTOTYPE( int do_safemap, (struct proc * caller, message *m_ptr) );
188 _PROTOTYPE( int do_saferevmap, (struct proc * caller, message *m_ptr) );
189 _PROTOTYPE( int do_safeunmap, (struct proc * caller, message *m_ptr) );
191 _PROTOTYPE( int do_sprofile, (struct proc * caller, message *m_ptr) );
192 #if ! SPROFILE
193 #define do_sprofile NULL
194 #endif
196 _PROTOTYPE( int do_cprofile, (struct proc * caller, message *m_ptr) );
197 _PROTOTYPE( int do_profbuf, (struct proc * caller, message *m_ptr) );
199 _PROTOTYPE( int do_getmcontext, (struct proc * caller, message *m_ptr) );
200 _PROTOTYPE( int do_setmcontext, (struct proc * caller, message *m_ptr) );
201 #if ! USE_MCONTEXT
202 #define do_getmcontext NULL
203 #define do_setmcontext NULL
204 #endif
206 _PROTOTYPE( int do_schedule, (struct proc * caller, message *m_ptr) );
207 _PROTOTYPE( int do_schedctl, (struct proc * caller, message *m_ptr) );
209 _PROTOTYPE( int do_statectl, (struct proc * caller, message *m_ptr) );
210 #if ! USE_STATECTL
211 #define do_statectl NULL
212 #endif
214 #endif /* SYSTEM_H */