connect OSS to the build (clean and install only)
[minix.git] / kernel / system.h
blob06aafb4feb88646cedc9f5a038daa2daedb82ebf
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 * Jul 30, 2005 created SYS_INT86 to support BIOS driver (Philip Homburg)
12 * Jul 13, 2005 created SYS_PRIVCTL to manage services (Jorrit N. Herder)
13 * Jul 09, 2005 updated SYS_KILL to signal services (Jorrit N. Herder)
14 * Jun 21, 2005 created SYS_NICE for nice(2) kernel call (Ben J. Gras)
15 * Jun 21, 2005 created SYS_MEMSET to speed up exec(2) (Ben J. Gras)
16 * Apr 12, 2005 updated SYS_VCOPY for virtual_copy() (Jorrit N. Herder)
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, (message *m_ptr) );
42 _PROTOTYPE( int do_exec, (message *m_ptr) );
43 #if ! USE_EXEC
44 #define do_exec do_unused
45 #endif
47 _PROTOTYPE( int do_fork, (message *m_ptr) );
48 #if ! USE_FORK
49 #define do_fork do_unused
50 #endif
52 _PROTOTYPE( int do_newmap, (message *m_ptr) );
53 #if ! USE_NEWMAP
54 #define do_newmap do_unused
55 #endif
57 _PROTOTYPE( int do_exit, (message *m_ptr) );
58 #if ! USE_EXIT
59 #define do_exit do_unused
60 #endif
62 _PROTOTYPE( int do_trace, (message *m_ptr) );
63 #if ! USE_TRACE
64 #define do_trace do_unused
65 #endif
67 _PROTOTYPE( int do_nice, (message *m_ptr) );
68 #if ! USE_NICE
69 #define do_nice do_unused
70 #endif
72 _PROTOTYPE( int do_runctl, (message *m_ptr) );
73 #if ! USE_RUNCTL
74 #define do_runctl do_unused
75 #endif
77 _PROTOTYPE( int do_copy, (message *m_ptr) );
78 #define do_vircopy do_copy
79 #if ! (USE_VIRCOPY || USE_PHYSCOPY)
80 #define do_copy do_unused
81 #endif
83 _PROTOTYPE( int do_vcopy, (message *m_ptr) );
84 #define do_virvcopy do_vcopy
85 #if ! (USE_VIRVCOPY || USE_PHYSVCOPY)
86 #define do_vcopy do_unused
87 #endif
89 _PROTOTYPE( int do_umap, (message *m_ptr) );
90 #if ! USE_UMAP
91 #define do_umap do_unused
92 #endif
94 _PROTOTYPE( int do_memset, (message *m_ptr) );
95 #if ! USE_MEMSET
96 #define do_memset do_unused
97 #endif
99 _PROTOTYPE( int do_abort, (message *m_ptr) );
100 #if ! USE_ABORT
101 #define do_abort do_unused
102 #endif
104 _PROTOTYPE( int do_getinfo, (message *m_ptr) );
105 #if ! USE_GETINFO
106 #define do_getinfo do_unused
107 #endif
109 _PROTOTYPE( int do_privctl, (message *m_ptr) );
110 #if ! USE_PRIVCTL
111 #define do_privctl do_unused
112 #endif
114 _PROTOTYPE( int do_segctl, (message *m_ptr) );
115 #if ! USE_SEGCTL
116 #define do_segctl do_unused
117 #endif
119 _PROTOTYPE( int do_irqctl, (message *m_ptr) );
120 #if ! USE_IRQCTL
121 #define do_irqctl do_unused
122 #endif
124 _PROTOTYPE( int do_devio, (message *m_ptr) );
125 #if ! USE_DEVIO
126 #define do_devio do_unused
127 #endif
129 _PROTOTYPE( int do_vdevio, (message *m_ptr) );
130 #if ! USE_VDEVIO
131 #define do_vdevio do_unused
132 #endif
134 _PROTOTYPE( int do_int86, (message *m_ptr) );
136 _PROTOTYPE( int do_sdevio, (message *m_ptr) );
137 #if ! USE_SDEVIO
138 #define do_sdevio do_unused
139 #endif
141 _PROTOTYPE( int do_kill, (message *m_ptr) );
142 #if ! USE_KILL
143 #define do_kill do_unused
144 #endif
146 _PROTOTYPE( int do_getksig, (message *m_ptr) );
147 #if ! USE_GETKSIG
148 #define do_getksig do_unused
149 #endif
151 _PROTOTYPE( int do_endksig, (message *m_ptr) );
152 #if ! USE_ENDKSIG
153 #define do_endksig do_unused
154 #endif
156 _PROTOTYPE( int do_sigsend, (message *m_ptr) );
157 #if ! USE_SIGSEND
158 #define do_sigsend do_unused
159 #endif
161 _PROTOTYPE( int do_sigreturn, (message *m_ptr) );
162 #if ! USE_SIGRETURN
163 #define do_sigreturn do_unused
164 #endif
166 _PROTOTYPE( int do_times, (message *m_ptr) );
167 #if ! USE_TIMES
168 #define do_times do_unused
169 #endif
171 _PROTOTYPE( int do_setalarm, (message *m_ptr) );
172 #if ! USE_SETALARM
173 #define do_setalarm do_unused
174 #endif
176 _PROTOTYPE( int do_stime, (message *m_ptr) );
178 _PROTOTYPE( int do_vtimer, (message *m_ptr) );
179 #if ! USE_VTIMER
180 #define do_vtimer do_unused
181 #endif
183 _PROTOTYPE( int do_safecopy, (message *m_ptr) );
184 _PROTOTYPE( int do_vsafecopy, (message *m_ptr) );
185 _PROTOTYPE( int do_iopenable, (message *m_ptr) );
186 _PROTOTYPE( int do_vmctl, (message *m_ptr) );
187 _PROTOTYPE( int do_setgrant, (message *m_ptr) );
188 _PROTOTYPE( int do_readbios, (message *m_ptr) );
189 _PROTOTYPE( int do_mapdma, (message *m_ptr) );
191 _PROTOTYPE( int do_sprofile, (message *m_ptr) );
192 #if ! SPROFILE
193 #define do_sprofile do_unused
194 #endif
196 _PROTOTYPE( int do_cprofile, (message *m_ptr) );
197 _PROTOTYPE( int do_profbuf, (message *m_ptr) );
199 _PROTOTYPE( int do_mapdma, (message *m_ptr) );
201 #endif /* SYSTEM_H */