vm: util.S not used currently; leave it out.
[minix.git] / kernel / system.h
blob832d3303dc16af073910516f67fb747f8cf6df84
1 /* Function prototypes for the system library. The prototypes in this file
2 * are undefined to do_unused 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 /* Default handler for unused kernel calls. */
40 _PROTOTYPE( int do_unused, (struct proc * caller, message *m_ptr) );
42 _PROTOTYPE( int do_exec, (struct proc * caller, message *m_ptr) );
43 #if ! USE_EXEC
44 #define do_exec do_unused
45 #endif
47 _PROTOTYPE( int do_fork, (struct proc * caller, message *m_ptr) );
48 #if ! USE_FORK
49 #define do_fork do_unused
50 #endif
52 _PROTOTYPE( int do_newmap, (struct proc * caller, message *m_ptr) );
53 #if ! USE_NEWMAP
54 #define do_newmap do_unused
55 #endif
57 _PROTOTYPE( int do_clear, (struct proc * caller, message *m_ptr) );
58 #if ! USE_CLEAR
59 #define do_clear do_unused
60 #endif
62 _PROTOTYPE( int do_trace, (struct proc * caller, message *m_ptr) );
63 #if ! USE_TRACE
64 #define do_trace do_unused
65 #endif
67 _PROTOTYPE( int do_runctl, (struct proc * caller, message *m_ptr) );
68 #if ! USE_RUNCTL
69 #define do_runctl do_unused
70 #endif
72 _PROTOTYPE( int do_update, (struct proc * caller, message *m_ptr) );
73 #if ! USE_UPDATE
74 #define do_update do_unused
75 #endif
77 _PROTOTYPE( int do_exit, (struct proc * caller, message *m_ptr) );
78 #if ! USE_EXIT
79 #define do_exit do_unused
80 #endif
82 _PROTOTYPE( int do_copy, (struct proc * caller, message *m_ptr) );
83 #define do_vircopy do_copy
84 #if ! (USE_VIRCOPY || USE_PHYSCOPY)
85 #define do_copy do_unused
86 #endif
88 _PROTOTYPE( int do_umap, (struct proc * caller, message *m_ptr) );
89 #if ! USE_UMAP
90 #define do_umap do_unused
91 #endif
93 _PROTOTYPE( int do_memset, (struct proc * caller, message *m_ptr) );
94 #if ! USE_MEMSET
95 #define do_memset do_unused
96 #endif
98 _PROTOTYPE( int do_abort, (struct proc * caller, message *m_ptr) );
99 #if ! USE_ABORT
100 #define do_abort do_unused
101 #endif
103 _PROTOTYPE( int do_getinfo, (struct proc * caller, message *m_ptr) );
104 #if ! USE_GETINFO
105 #define do_getinfo do_unused
106 #endif
108 _PROTOTYPE( int do_privctl, (struct proc * caller, message *m_ptr) );
109 #if ! USE_PRIVCTL
110 #define do_privctl do_unused
111 #endif
113 _PROTOTYPE( int do_segctl, (struct proc * caller, message *m_ptr) );
114 #if ! USE_SEGCTL
115 #define do_segctl do_unused
116 #endif
118 _PROTOTYPE( int do_irqctl, (struct proc * caller, message *m_ptr) );
119 #if ! USE_IRQCTL
120 #define do_irqctl do_unused
121 #endif
123 _PROTOTYPE( int do_devio, (struct proc * caller, message *m_ptr) );
124 #if ! USE_DEVIO
125 #define do_devio do_unused
126 #endif
128 _PROTOTYPE( int do_vdevio, (struct proc * caller, message *m_ptr) );
129 #if ! USE_VDEVIO
130 #define do_vdevio do_unused
131 #endif
133 _PROTOTYPE( int do_int86, (struct proc * caller, message *m_ptr) );
135 _PROTOTYPE( int do_sdevio, (struct proc * caller, message *m_ptr) );
136 #if ! USE_SDEVIO
137 #define do_sdevio do_unused
138 #endif
140 _PROTOTYPE( int do_kill, (struct proc * caller, message *m_ptr) );
141 #if ! USE_KILL
142 #define do_kill do_unused
143 #endif
145 _PROTOTYPE( int do_getksig, (struct proc * caller, message *m_ptr) );
146 #if ! USE_GETKSIG
147 #define do_getksig do_unused
148 #endif
150 _PROTOTYPE( int do_endksig, (struct proc * caller, message *m_ptr) );
151 #if ! USE_ENDKSIG
152 #define do_endksig do_unused
153 #endif
155 _PROTOTYPE( int do_sigsend, (struct proc * caller, message *m_ptr) );
156 #if ! USE_SIGSEND
157 #define do_sigsend do_unused
158 #endif
160 _PROTOTYPE( int do_sigreturn, (struct proc * caller, message *m_ptr) );
161 #if ! USE_SIGRETURN
162 #define do_sigreturn do_unused
163 #endif
165 _PROTOTYPE( int do_times, (struct proc * caller, message *m_ptr) );
166 #if ! USE_TIMES
167 #define do_times do_unused
168 #endif
170 _PROTOTYPE( int do_setalarm, (struct proc * caller, message *m_ptr) );
171 #if ! USE_SETALARM
172 #define do_setalarm do_unused
173 #endif
175 _PROTOTYPE( int do_stime, (struct proc * caller, message *m_ptr) );
177 _PROTOTYPE( int do_vtimer, (struct proc * caller, message *m_ptr) );
178 #if ! USE_VTIMER
179 #define do_vtimer do_unused
180 #endif
182 _PROTOTYPE( int do_safecopy, (struct proc * caller, message *m_ptr) );
183 _PROTOTYPE( int do_vsafecopy, (struct proc * caller, message *m_ptr) );
184 _PROTOTYPE( int do_iopenable, (struct proc * caller, message *m_ptr) );
185 _PROTOTYPE( int do_vmctl, (struct proc * caller, message *m_ptr) );
186 _PROTOTYPE( int do_setgrant, (struct proc * caller, message *m_ptr) );
187 _PROTOTYPE( int do_readbios, (struct proc * caller, message *m_ptr) );
189 _PROTOTYPE( int do_safemap, (struct proc * caller, message *m_ptr) );
190 _PROTOTYPE( int do_saferevmap, (struct proc * caller, message *m_ptr) );
191 _PROTOTYPE( int do_safeunmap, (struct proc * caller, message *m_ptr) );
193 _PROTOTYPE( int do_sprofile, (struct proc * caller, message *m_ptr) );
194 #if ! SPROFILE
195 #define do_sprofile do_unused
196 #endif
198 _PROTOTYPE( int do_cprofile, (struct proc * caller, message *m_ptr) );
199 _PROTOTYPE( int do_profbuf, (struct proc * caller, message *m_ptr) );
201 _PROTOTYPE( int do_getmcontext, (struct proc * caller, message *m_ptr) );
202 _PROTOTYPE( int do_setmcontext, (struct proc * caller, message *m_ptr) );
203 #if ! USE_MCONTEXT
204 #define do_getmcontext do_unused
205 #define do_setmcontext do_unused
206 #endif
208 _PROTOTYPE( int do_schedule, (struct proc * caller, message *m_ptr) );
209 _PROTOTYPE( int do_schedctl, (struct proc * caller, message *m_ptr) );
211 _PROTOTYPE( int do_statectl, (struct proc * caller, message *m_ptr) );
212 #if ! USE_STATECTL
213 #define do_statectl do_unused
214 #endif
216 #endif /* SYSTEM_H */