xref: /minix3/minix/kernel/system.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
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/.
4  *
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  */
29 
30 #ifndef SYSTEM_H
31 #define SYSTEM_H
32 
33 #include "kernel/kernel.h"
34 
35 int do_exec(struct proc * caller, message *m_ptr);
36 #if ! USE_EXEC
37 #define do_exec NULL
38 #endif
39 
40 int do_fork(struct proc * caller, message *m_ptr);
41 #if ! USE_FORK
42 #define do_fork NULL
43 #endif
44 
45 int do_clear(struct proc * caller, message *m_ptr);
46 #if ! USE_CLEAR
47 #define do_clear NULL
48 #endif
49 
50 int do_trace(struct proc * caller, message *m_ptr);
51 #if ! USE_TRACE
52 #define do_trace NULL
53 #endif
54 
55 int do_runctl(struct proc * caller, message *m_ptr);
56 #if ! USE_RUNCTL
57 #define do_runctl NULL
58 #endif
59 
60 int do_update(struct proc * caller, message *m_ptr);
61 #if ! USE_UPDATE
62 #define do_update NULL
63 #endif
64 
65 int do_exit(struct proc * caller, message *m_ptr);
66 #if ! USE_EXIT
67 #define do_exit NULL
68 #endif
69 
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
75 
76 int do_umap(struct proc * caller, message *m_ptr);
77 #if ! USE_UMAP
78 #define do_umap NULL
79 #endif
80 
81 int do_umap_remote(struct proc * caller, message *m_ptr);
82 #if ! USE_UMAP_REMOTE
83 #define do_umap_remote NULL
84 #endif
85 
86 int do_vumap(struct proc * caller, message *m_ptr);
87 #if ! USE_VUMAP
88 #define do_vumap NULL
89 #endif
90 
91 int do_memset(struct proc * caller, message *m_ptr);
92 #if ! USE_MEMSET
93 #define do_memset NULL
94 #endif
95 
96 int do_abort(struct proc * caller, message *m_ptr);
97 #if ! USE_ABORT
98 #define do_abort NULL
99 #endif
100 
101 int do_getinfo(struct proc * caller, message *m_ptr);
102 #if ! USE_GETINFO
103 #define do_getinfo NULL
104 #endif
105 
106 int do_privctl(struct proc * caller, message *m_ptr);
107 #if ! USE_PRIVCTL
108 #define do_privctl NULL
109 #endif
110 
111 int do_irqctl(struct proc * caller, message *m_ptr);
112 #if ! USE_IRQCTL
113 #define do_irqctl NULL
114 #endif
115 
116 int do_devio(struct proc * caller, message *m_ptr);
117 #if ! USE_DEVIO
118 #define do_devio NULL
119 #endif
120 
121 int do_vdevio(struct proc * caller, message *m_ptr);
122 #if ! USE_VDEVIO
123 #define do_vdevio NULL
124 #endif
125 
126 int do_sdevio(struct proc * caller, message *m_ptr);
127 #if ! USE_SDEVIO
128 #define do_sdevio NULL
129 #endif
130 
131 int do_kill(struct proc * caller, message *m_ptr);
132 #if ! USE_KILL
133 #define do_kill NULL
134 #endif
135 
136 int do_getksig(struct proc * caller, message *m_ptr);
137 #if ! USE_GETKSIG
138 #define do_getksig NULL
139 #endif
140 
141 int do_endksig(struct proc * caller, message *m_ptr);
142 #if ! USE_ENDKSIG
143 #define do_endksig NULL
144 #endif
145 
146 int do_sigsend(struct proc * caller, message *m_ptr);
147 #if ! USE_SIGSEND
148 #define do_sigsend NULL
149 #endif
150 
151 int do_sigreturn(struct proc * caller, message *m_ptr);
152 #if ! USE_SIGRETURN
153 #define do_sigreturn NULL
154 #endif
155 
156 int do_times(struct proc * caller, message *m_ptr);
157 #if ! USE_TIMES
158 #define do_times NULL
159 #endif
160 
161 int do_setalarm(struct proc * caller, message *m_ptr);
162 #if ! USE_SETALARM
163 #define do_setalarm NULL
164 #endif
165 
166 int do_stime(struct proc * caller, message *m_ptr);
167 int do_settime(struct proc * caller, message *m_ptr);
168 
169 int do_vtimer(struct proc * caller, message *m_ptr);
170 #if ! USE_VTIMER
171 #define do_vtimer NULL
172 #endif
173 
174 int do_safecopy_to(struct proc * caller, message *m_ptr);
175 int do_safecopy_from(struct proc * caller, message *m_ptr);
176 int do_vsafecopy(struct proc * caller, message *m_ptr);
177 int do_iopenable(struct proc * caller, message *m_ptr);
178 int do_vmctl(struct proc * caller, message *m_ptr);
179 int do_setgrant(struct proc * caller, message *m_ptr);
180 int do_readbios(struct proc * caller, message *m_ptr);
181 
182 int do_safememset(struct proc * caller, message *m_ptr);
183 
184 int do_sprofile(struct proc * caller, message *m_ptr);
185 #if ! SPROFILE
186 #define do_sprofile NULL
187 #endif
188 
189 int do_cprofile(struct proc * caller, message *m_ptr);
190 int do_profbuf(struct proc * caller, message *m_ptr);
191 #if ! CPROFILE
192 #define do_cprofile NULL
193 #define do_profbuf NULL
194 #endif
195 
196 int do_getmcontext(struct proc * caller, message *m_ptr);
197 int do_setmcontext(struct proc * caller, message *m_ptr);
198 #if ! USE_MCONTEXT
199 #define do_getmcontext NULL
200 #define do_setmcontext NULL
201 #endif
202 
203 int do_schedule(struct proc * caller, message *m_ptr);
204 int do_schedctl(struct proc * caller, message *m_ptr);
205 
206 int do_statectl(struct proc * caller, message *m_ptr);
207 #if ! USE_STATECTL
208 #define do_statectl NULL
209 #endif
210 
211 int do_padconf(struct proc * caller, message *m_ptr);
212 #if ! USE_PADCONF
213 #define do_padconf NULL
214 #endif
215 
216 #endif	/* SYSTEM_H */
217 
218