fp might be NULL.
[minix.git] / include / minix / com.h
blob202a79968eb7225b7b9472179353bb45de461458
1 #ifndef _MINIX_COM_H
2 #define _MINIX_COM_H
4 /*===========================================================================*
5 * Magic process numbers *
6 *===========================================================================*/
8 /* These may not be any valid endpoint (see <minix/endpoint.h>). */
9 #define ANY 0x7ace /* used to indicate 'any process' */
10 #define NONE 0x6ace /* used to indicate 'no process at all' */
11 #define SELF 0x8ace /* used to indicate 'own process' */
12 #define _MAX_MAGIC_PROC (SELF) /* used by <minix/endpoint.h>
13 to determine generation size */
15 /*===========================================================================*
16 * Process numbers of processes in the system image *
17 *===========================================================================*/
19 /* The values of several task numbers depend on whether they or other tasks
20 * are enabled. They are defined as (PREVIOUS_TASK - ENABLE_TASK) in general.
21 * ENABLE_TASK is either 0 or 1, so a task either gets a new number, or gets
22 * the same number as the previous task and is further unused. Note that the
23 * order should correspond to the order in the task table defined in table.c.
26 /* Kernel tasks. These all run in the same address space. */
27 #define IDLE -4 /* runs when no one else can run */
28 #define CLOCK -3 /* alarms and other clock functions */
29 #define SYSTEM -2 /* request system functionality */
30 #define KERNEL -1 /* pseudo-process for IPC and scheduling */
31 #define HARDWARE KERNEL /* for hardware interrupt handlers */
33 /* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */
34 #define NR_TASKS 4
36 /* User-space processes, that is, device drivers, servers, and INIT. */
37 #define PM_PROC_NR 0 /* process manager */
38 #define FS_PROC_NR 1 /* file system */
39 #define VFS_PROC_NR FS_PROC_NR /* FS has been renamed to VFS. */
40 #define RS_PROC_NR 2 /* memory driver (RAM disk, null, etc.) */
41 #define MEM_PROC_NR 3 /* memory driver (RAM disk, null, etc.) */
42 #define LOG_PROC_NR 4 /* log device driver */
43 #define TTY_PROC_NR 5 /* terminal (TTY) driver */
44 #define DS_PROC_NR 6 /* data store server */
45 #define MFS_PROC_NR 7 /* minix root filesystem */
46 #define VM_PROC_NR 8 /* memory server */
47 #define INIT_PROC_NR 9 /* init -- goes multiuser */
49 /* Number of processes contained in the system image. */
50 #define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1)
52 /*===========================================================================*
53 * Kernel notification types *
54 *===========================================================================*/
56 /* Kernel notification types. In principle, these can be sent to any process,
57 * so make sure that these types do not interfere with other message types.
58 * Notifications are prioritized because of the way they are unhold() and
59 * blocking notifications are delivered. The lowest numbers go first. The
60 * offset are used for the per-process notification bit maps.
62 #define NOTIFY_MESSAGE 0x1000
63 #define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS))
64 # define PROC_EVENT NOTIFY_FROM(PM_PROC_NR) /* process status change */
65 # define SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */
66 # define SYS_SIG NOTIFY_FROM(SYSTEM) /* system signal */
67 # define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */
68 # define FKEY_PRESSED NOTIFY_FROM(TTY_PROC_NR)/* function key press */
69 # define DEV_PING NOTIFY_FROM(RS_PROC_NR) /* driver liveness ping */
70 # define DS_UPDATE NOTIFY_FROM(DS_PROC_NR) /* subscription update */
72 /* Shorthands for message parameters passed with notifications. */
73 #define NOTIFY_SOURCE m_source
74 #define NOTIFY_TYPE m_type
75 #define NOTIFY_ARG m2_l1
76 #define NOTIFY_TIMESTAMP m2_l2
77 #define NOTIFY_FLAGS m2_i1
79 /*===========================================================================*
80 * Messages for BUS controller drivers *
81 *===========================================================================*/
82 #define BUSC_RQ_BASE 0x300 /* base for request types */
83 #define BUSC_RS_BASE 0x380 /* base for response types */
85 #define BUSC_PCI_INIT (BUSC_RQ_BASE + 0) /* First message to
86 * PCI driver
88 #define BUSC_PCI_FIRST_DEV (BUSC_RQ_BASE + 1) /* Get index (and
89 * vid/did) of the
90 * first PCI device
92 #define BUSC_PCI_NEXT_DEV (BUSC_RQ_BASE + 2) /* Get index (and
93 * vid/did) of the
94 * next PCI device
96 #define BUSC_PCI_FIND_DEV (BUSC_RQ_BASE + 3) /* Get index of a
97 * PCI device based on
98 * bus/dev/function
100 #define BUSC_PCI_IDS (BUSC_RQ_BASE + 4) /* Get vid/did from an
101 * index
103 #define BUSC_PCI_DEV_NAME (BUSC_RQ_BASE + 5) /* Get the name of a
104 * PCI device
106 #define BUSC_PCI_SLOT_NAME (BUSC_RQ_BASE + 6) /* Get the name of a
107 * PCI slot
109 #define BUSC_PCI_RESERVE (BUSC_RQ_BASE + 7) /* Reserve a PCI dev */
110 #define BUSC_PCI_ATTR_R8 (BUSC_RQ_BASE + 8) /* Read 8-bit
111 * attribute value
113 #define BUSC_PCI_ATTR_R16 (BUSC_RQ_BASE + 9) /* Read 16-bit
114 * attribute value
116 #define BUSC_PCI_ATTR_R32 (BUSC_RQ_BASE + 10) /* Read 32-bit
117 * attribute value
119 #define BUSC_PCI_ATTR_W8 (BUSC_RQ_BASE + 11) /* Write 8-bit
120 * attribute value
122 #define BUSC_PCI_ATTR_W16 (BUSC_RQ_BASE + 12) /* Write 16-bit
123 * attribute value
125 #define BUSC_PCI_ATTR_W32 (BUSC_RQ_BASE + 13) /* Write 32-bit
126 * attribute value
128 #define BUSC_PCI_RESCAN (BUSC_RQ_BASE + 14) /* Rescan bus */
129 #define BUSC_PCI_DEV_NAME_S (BUSC_RQ_BASE + 15) /* Get the name of a
130 * PCI device
131 * (safecopy)
133 #define BUSC_PCI_SLOT_NAME_S (BUSC_RQ_BASE + 16) /* Get the name of a
134 * PCI slot (safecopy)
136 #define BUSC_PCI_SET_ACL (BUSC_RQ_BASE + 17) /* Set the ACL for a
137 * driver (safecopy)
139 #define BUSC_PCI_DEL_ACL (BUSC_RQ_BASE + 18) /* Delete the ACL of a
140 * driver
142 #define IOMMU_MAP (BUSC_RQ_BASE + 32) /* Ask IOMMU to map
143 * a segment of memory
148 /*===========================================================================*
149 * Messages for BLOCK and CHARACTER device drivers *
150 *===========================================================================*/
152 /* Message types for device drivers. */
153 #define DEV_RQ_BASE 0x400 /* base for device request types */
154 #define DEV_RS_BASE 0x500 /* base for device response types */
156 #define CANCEL (DEV_RQ_BASE + 0) /* force a task to cancel */
157 #define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */
158 #define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */
159 #define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */
160 #define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */
161 #define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */
162 #define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */
163 #define DEV_REOPEN (DEV_RQ_BASE + 14) /* reopen a minor device */
165 #define DEV_READ_S (DEV_RQ_BASE + 20) /* (safecopy) read from minor */
166 #define DEV_WRITE_S (DEV_RQ_BASE + 21) /* (safecopy) write to minor */
167 #define DEV_SCATTER_S (DEV_RQ_BASE + 22) /* (safecopy) write from a vector */
168 #define DEV_GATHER_S (DEV_RQ_BASE + 23) /* (safecopy) read into a vector */
169 #define DEV_IOCTL_S (DEV_RQ_BASE + 24) /* (safecopy) I/O control code */
170 #define DEV_MMAP_S (DEV_RQ_BASE + 25) /* (safecopy) mmap interface */
172 #define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */
173 #define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */
174 #define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */
175 #define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */
176 #define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply */
177 #define DEV_REOPEN_REPL (DEV_RS_BASE + 5) /* reply to DEV_REOPEN */
178 #define DEV_CLOSE_REPL (DEV_RS_BASE + 6) /* reply to DEV_CLOSE */
179 #define DEV_SEL_REPL1 (DEV_RS_BASE + 7) /* first reply to DEV_SELECT */
180 #define DEV_SEL_REPL2 (DEV_RS_BASE + 8) /* (opt) second reply to DEV_SELECT */
182 /* Field names for messages to block and character device drivers. */
183 #define DEVICE m2_i1 /* major-minor device */
184 #define IO_ENDPT m2_i2 /* which (proc/endpoint) wants I/O? */
185 #define COUNT m2_i3 /* how many bytes to transfer */
186 #define REQUEST m2_i3 /* ioctl request code */
187 #define POSITION m2_l1 /* file offset (low 4 bytes) */
188 #define HIGHPOS m2_l2 /* file offset (high 4 bytes) */
189 #define ADDRESS m2_p1 /* core buffer address */
190 #define IO_GRANT m2_p1 /* grant id (for DEV_*_S variants) */
192 /* Field names for DEV_SELECT messages to device drivers. */
193 #define DEV_MINOR m2_i1 /* minor device */
194 #define DEV_SEL_OPS m2_i2 /* which select operations are requested */
196 /* Field names used in reply messages from tasks. */
197 #define REP_ENDPT m2_i1 /* # of proc on whose behalf I/O was done */
198 #define REP_STATUS m2_i2 /* bytes transferred or error number */
199 #define REP_IO_GRANT m2_i3 /* DEV_REVIVE: grant by which I/O was done */
200 # define SUSPEND -998 /* status to suspend caller, reply later */
202 /* Field names for messages to TTY driver. */
203 #define TTY_LINE DEVICE /* message parameter: terminal line */
204 #define TTY_REQUEST COUNT /* message parameter: ioctl request code */
205 #define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */
206 #define TTY_PGRP m2_i3 /* message parameter: process group */
208 /* Field names for the QIC 02 status reply from tape driver */
209 #define TAPE_STAT0 m2_l1
210 #define TAPE_STAT1 m2_l2
212 /*===========================================================================*
213 * Messages for networking layer *
214 *===========================================================================*/
216 /* Message types for network layer requests. This layer acts like a driver. */
217 #define NW_OPEN DEV_OPEN
218 #define NW_CLOSE DEV_CLOSE
219 #define NW_READ DEV_READ
220 #define NW_WRITE DEV_WRITE
221 #define NW_IOCTL DEV_IOCTL
222 #define NW_CANCEL CANCEL
224 /* Base type for data link layer requests and responses. */
225 #define DL_RQ_BASE 0x800
226 #define DL_RS_BASE 0x900
228 /* Message types for data link layer requests. */
229 #define DL_WRITE (DL_RQ_BASE + 3)
230 #define DL_WRITEV (DL_RQ_BASE + 4)
231 #define DL_READ (DL_RQ_BASE + 5)
232 #define DL_READV (DL_RQ_BASE + 6)
233 #define DL_CONF (DL_RQ_BASE + 7)
234 #define DL_STOP (DL_RQ_BASE + 8)
235 #define DL_GETSTAT (DL_RQ_BASE + 9)
236 #define DL_GETNAME (DL_RQ_BASE +10)
237 #define DL_WRITEV_S (DL_RQ_BASE +11)
238 #define DL_READV_S (DL_RQ_BASE +12)
239 #define DL_GETSTAT_S (DL_RQ_BASE +13)
241 /* Message type for data link layer replies. */
242 #define DL_CONF_REPLY (DL_RS_BASE + 20)
243 #define DL_TASK_REPLY (DL_RS_BASE + 21)
244 #define DL_NAME_REPLY (DL_RS_BASE + 22)
245 #define DL_STAT_REPLY (DL_RS_BASE + 23)
247 /* Field names for data link layer messages. */
248 #define DL_PORT m2_i1
249 #define DL_PROC m2_i2 /* endpoint */
250 #define DL_COUNT m2_i3
251 #define DL_MODE m2_l1
252 #define DL_CLCK m2_l2
253 #define DL_ADDR m2_p1
254 #define DL_STAT m2_l1
255 #define DL_GRANT m2_l2
256 #define DL_NAME m3_ca1
258 /* Bits in 'DL_STAT' field of DL replies. */
259 # define DL_PACK_SEND 0x01
260 # define DL_PACK_RECV 0x02
261 # define DL_READ_IP 0x04
263 /* Bits in 'DL_MODE' field of DL requests. */
264 # define DL_NOMODE 0x0
265 # define DL_PROMISC_REQ 0x2
266 # define DL_MULTI_REQ 0x4
267 # define DL_BROAD_REQ 0x8
269 /*===========================================================================*
270 * SYSTASK request types and field names *
271 *===========================================================================*/
273 /* System library calls are dispatched via a call vector, so be careful when
274 * modifying the system call numbers. The numbers here determine which call
275 * is made from the call vector.
277 #define KERNEL_CALL 0x600 /* base for kernel calls to SYSTEM */
279 # define SYS_FORK (KERNEL_CALL + 0) /* sys_fork() */
280 # define SYS_EXEC (KERNEL_CALL + 1) /* sys_exec() */
281 # define SYS_EXIT (KERNEL_CALL + 2) /* sys_exit() */
282 # define SYS_NICE (KERNEL_CALL + 3) /* sys_nice() */
283 # define SYS_PRIVCTL (KERNEL_CALL + 4) /* sys_privctl() */
284 # define SYS_TRACE (KERNEL_CALL + 5) /* sys_trace() */
285 # define SYS_KILL (KERNEL_CALL + 6) /* sys_kill() */
287 # define SYS_GETKSIG (KERNEL_CALL + 7) /* sys_getsig() */
288 # define SYS_ENDKSIG (KERNEL_CALL + 8) /* sys_endsig() */
289 # define SYS_SIGSEND (KERNEL_CALL + 9) /* sys_sigsend() */
290 # define SYS_SIGRETURN (KERNEL_CALL + 10) /* sys_sigreturn() */
292 # define SYS_NEWMAP (KERNEL_CALL + 11) /* sys_newmap() */
293 # define SYS_SEGCTL (KERNEL_CALL + 12) /* sys_segctl() */
294 # define SYS_MEMSET (KERNEL_CALL + 13) /* sys_memset() */
296 # define SYS_UMAP (KERNEL_CALL + 14) /* sys_umap() */
297 # define SYS_VIRCOPY (KERNEL_CALL + 15) /* sys_vircopy() */
298 # define SYS_PHYSCOPY (KERNEL_CALL + 16) /* sys_physcopy() */
299 # define SYS_VIRVCOPY (KERNEL_CALL + 17) /* sys_virvcopy() */
300 # define SYS_PHYSVCOPY (KERNEL_CALL + 18) /* sys_physvcopy() */
302 # define SYS_IRQCTL (KERNEL_CALL + 19) /* sys_irqctl() */
303 # define SYS_INT86 (KERNEL_CALL + 20) /* sys_int86() */
304 # define SYS_DEVIO (KERNEL_CALL + 21) /* sys_devio() */
305 # define SYS_SDEVIO (KERNEL_CALL + 22) /* sys_sdevio() */
306 # define SYS_VDEVIO (KERNEL_CALL + 23) /* sys_vdevio() */
308 # define SYS_SETALARM (KERNEL_CALL + 24) /* sys_setalarm() */
309 # define SYS_TIMES (KERNEL_CALL + 25) /* sys_times() */
310 # define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */
311 # define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */
312 # define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
313 # define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
314 # define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
315 # define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */
316 # define SYS_SETGRANT (KERNEL_CALL + 34) /* sys_setgrant() */
317 # define SYS_READBIOS (KERNEL_CALL + 35) /* sys_readbios() */
319 # define SYS_SPROF (KERNEL_CALL + 36) /* sys_sprof() */
320 # define SYS_CPROF (KERNEL_CALL + 37) /* sys_cprof() */
321 # define SYS_PROFBUF (KERNEL_CALL + 38) /* sys_profbuf() */
323 # define SYS_STIME (KERNEL_CALL + 39) /* sys_stime() */
325 # define SYS_MAPDMA (KERNEL_CALL + 42) /* sys_mapdma() */
326 # define SYS_VMCTL (KERNEL_CALL + 43) /* sys_vmctl() */
327 # define SYS_SYSCTL (KERNEL_CALL + 44) /* sys_sysctl() */
329 # define SYS_VTIMER (KERNEL_CALL + 45) /* sys_vtimer() */
331 #define NR_SYS_CALLS 46 /* number of system calls */
333 /* Pseudo call for use in kernel/table.c. */
334 #define SYS_ALL_CALLS (NR_SYS_CALLS)
336 /* Subfunctions for SYS_PRIVCTL */
337 #define SYS_PRIV_INIT 1 /* Initialize a privilege structure */
338 #define SYS_PRIV_ADD_IO 2 /* Add I/O range (struct io_range) */
339 #define SYS_PRIV_ADD_MEM 3 /* Add memory range (struct mem_range)
341 #define SYS_PRIV_ADD_IRQ 4 /* Add IRQ */
342 #define SYS_PRIV_USER 5 /* Make a process an oridinary user
343 * process.
346 /* Subfunctions for SYS_SETGRANT */
347 #define SYS_PARAM_SET_GRANT 1 /* Set address and size of grant table */
349 /* Field names for SYS_MEMSET, SYS_SEGCTL. */
350 #define MEM_PTR m2_p1 /* base */
351 #define MEM_COUNT m2_l1 /* count */
352 #define MEM_PATTERN m2_l2 /* pattern to write */
353 #define MEM_CHUNK_BASE m4_l1 /* physical base address */
354 #define MEM_CHUNK_SIZE m4_l2 /* size of mem chunk */
355 #define MEM_TOT_SIZE m4_l3 /* total memory size */
356 #define MEM_CHUNK_TAG m4_l4 /* tag to identify chunk of mem */
358 /* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
359 #define DIO_REQUEST m2_i3 /* device in or output */
360 # define _DIO_INPUT 0x001
361 # define _DIO_OUTPUT 0x002
362 # define _DIO_DIRMASK 0x00f
363 # define _DIO_BYTE 0x010
364 # define _DIO_WORD 0x020
365 # define _DIO_LONG 0x030
366 # define _DIO_TYPEMASK 0x0f0
367 # define _DIO_SAFE 0x100
368 # define _DIO_SAFEMASK 0xf00
369 # define DIO_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE)
370 # define DIO_INPUT_WORD (_DIO_INPUT|_DIO_WORD)
371 # define DIO_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE)
372 # define DIO_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD)
373 # define DIO_SAFE_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE|_DIO_SAFE)
374 # define DIO_SAFE_INPUT_WORD (_DIO_INPUT|_DIO_WORD|_DIO_SAFE)
375 # define DIO_SAFE_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE|_DIO_SAFE)
376 # define DIO_SAFE_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD|_DIO_SAFE)
377 #define DIO_PORT m2_l1 /* single port address */
378 #define DIO_VALUE m2_l2 /* single I/O value */
379 #define DIO_VEC_ADDR m2_p1 /* address of buffer or (p,v)-pairs */
380 #define DIO_VEC_SIZE m2_l2 /* number of elements in vector */
381 #define DIO_VEC_ENDPT m2_i2 /* number of process where vector is */
382 #define DIO_OFFSET m2_i1 /* offset from grant */
384 /* Field names for SYS_SIGNARLM, SYS_FLAGARLM, SYS_SYNCALRM. */
385 #define ALRM_EXP_TIME m2_l1 /* expire time for the alarm call */
386 #define ALRM_ABS_TIME m2_i2 /* set to 1 to use absolute alarm time */
387 #define ALRM_TIME_LEFT m2_l1 /* how many ticks were remaining */
388 #define ALRM_ENDPT m2_i1 /* which process wants the alarm? */
389 #define ALRM_FLAG_PTR m2_p1 /* virtual address of timeout flag */
391 /* Field names for SYS_IRQCTL. */
392 #define IRQ_REQUEST m5_c1 /* what to do? */
393 # define IRQ_SETPOLICY 1 /* manage a slot of the IRQ table */
394 # define IRQ_RMPOLICY 2 /* remove a slot of the IRQ table */
395 # define IRQ_ENABLE 3 /* enable interrupts */
396 # define IRQ_DISABLE 4 /* disable interrupts */
397 #define IRQ_VECTOR m5_c2 /* irq vector */
398 #define IRQ_POLICY m5_i1 /* options for IRQCTL request */
399 # define IRQ_REENABLE 0x001 /* reenable IRQ line after interrupt */
400 # define IRQ_BYTE 0x100 /* byte values */
401 # define IRQ_WORD 0x200 /* word values */
402 # define IRQ_LONG 0x400 /* long values */
403 #define IRQ_HOOK_ID m5_l3 /* id of irq hook at kernel */
405 /* Field names for SYS_SEGCTL. */
406 #define SEG_SELECT m4_l1 /* segment selector returned */
407 #define SEG_OFFSET m4_l2 /* offset in segment returned */
408 #define SEG_PHYS m4_l3 /* physical address of segment */
409 #define SEG_SIZE m4_l4 /* segment size */
410 #define SEG_INDEX m4_l5 /* segment index in remote map */
412 /* Field names for SYS_VIDCOPY. */
413 #define VID_REQUEST m4_l1 /* what to do? */
414 # define VID_VID_COPY 1 /* request vid_vid_copy() */
415 # define MEM_VID_COPY 2 /* request mem_vid_copy() */
416 #define VID_SRC_ADDR m4_l2 /* virtual address in memory */
417 #define VID_SRC_OFFSET m4_l3 /* offset in video memory */
418 #define VID_DST_OFFSET m4_l4 /* offset in video memory */
419 #define VID_CP_COUNT m4_l5 /* number of words to be copied */
421 /* Field names for SYS_ABORT. */
422 #define ABRT_HOW m1_i1 /* RBT_REBOOT, RBT_HALT, etc. */
423 #define ABRT_MON_ENDPT m1_i2 /* process where monitor params are */
424 #define ABRT_MON_LEN m1_i3 /* length of monitor params */
425 #define ABRT_MON_ADDR m1_p1 /* virtual address of monitor params */
427 /* Field names for _UMAP, _VIRCOPY, _PHYSCOPY. */
428 #define CP_SRC_SPACE m5_c1 /* T or D space (stack is also D) */
429 #define CP_SRC_ENDPT m5_i1 /* process to copy from */
430 #define CP_SRC_ADDR m5_l1 /* address where data come from */
431 #define CP_DST_SPACE m5_c2 /* T or D space (stack is also D) */
432 #define CP_DST_ENDPT m5_i2 /* process to copy to */
433 #define CP_DST_ADDR m5_l2 /* address where data go to */
434 #define CP_NR_BYTES m5_l3 /* number of bytes to copy */
436 /* Field names for SYS_VCOPY and SYS_VVIRCOPY. */
437 #define VCP_NR_OK m1_i2 /* number of successfull copies */
438 #define VCP_VEC_SIZE m1_i3 /* size of copy vector */
439 #define VCP_VEC_ADDR m1_p1 /* pointer to copy vector */
441 /* Field names for SYS_GETINFO. */
442 #define I_REQUEST m7_i3 /* what info to get */
443 # define GET_KINFO 0 /* get kernel information structure */
444 # define GET_IMAGE 1 /* get system image table */
445 # define GET_PROCTAB 2 /* get kernel process table */
446 # define GET_RANDOMNESS 3 /* get randomness buffer */
447 # define GET_MONPARAMS 4 /* get monitor parameters */
448 # define GET_KENV 5 /* get kernel environment string */
449 # define GET_IRQHOOKS 6 /* get the IRQ table */
450 # define GET_KMESSAGES 7 /* get kernel messages */
451 # define GET_PRIVTAB 8 /* get kernel privileges table */
452 # define GET_KADDRESSES 9 /* get various kernel addresses */
453 # define GET_SCHEDINFO 10 /* get scheduling queues */
454 # define GET_PROC 11 /* get process slot if given process */
455 # define GET_MACHINE 12 /* get machine information */
456 # define GET_LOCKTIMING 13 /* get lock()/unlock() latency timing */
457 # define GET_BIOSBUFFER 14 /* get a buffer for BIOS calls */
458 # define GET_LOADINFO 15 /* get load average information */
459 # define GET_IRQACTIDS 16 /* get the IRQ masks */
460 # define GET_PRIVID 17 /* get ID of privilege structure */
461 # define GET_HZ 18 /* get HZ value */
462 # define GET_WHOAMI 19 /* get own name and endpoint */
463 # define GET_RANDOMNESS_BIN 20 /* get one randomness bin */
464 #define I_ENDPT m7_i4 /* calling process */
465 #define I_VAL_PTR m7_p1 /* virtual address at caller */
466 #define I_VAL_LEN m7_i1 /* max length of value */
467 #define I_VAL_PTR2 m7_p2 /* second virtual address */
468 #define I_VAL_LEN2_E m7_i2 /* second length, or proc nr */
470 /* GET_WHOAMI fields. */
471 #define GIWHO_EP m3_i1
472 #define GIWHO_NAME m3_ca1
474 /* Field names for SYS_TIMES. */
475 #define T_ENDPT m4_l1 /* process to request time info for */
476 #define T_USER_TIME m4_l1 /* user time consumed by process */
477 #define T_SYSTEM_TIME m4_l2 /* system time consumed by process */
478 #define T_BOOTTIME m4_l3 /* Boottime in seconds (also for SYS_STIME) */
479 #define T_BOOT_TICKS m4_l5 /* number of clock ticks since boot time */
483 /* vm_map */
484 #define VM_MAP_ENDPT m4_l1
485 #define VM_MAP_MAPUNMAP m4_l2
486 #define VM_MAP_BASE m4_l3
487 #define VM_MAP_SIZE m4_l4
488 #define VM_MAP_ADDR m4_l5
490 /* Field names for SYS_TRACE, SYS_PRIVCTL. */
491 #define CTL_ENDPT m2_i1 /* process number of the caller */
492 #define CTL_REQUEST m2_i2 /* server control request */
493 #define CTL_ARG_PTR m2_p1 /* pointer to argument */
494 #define CTL_ADDRESS m2_l1 /* address at traced process' space */
495 #define CTL_DATA m2_l2 /* data field for tracing */
497 /* Field names for SYS_SETGRANT */
498 #define SG_ADDR m2_p1 /* address */
499 #define SG_SIZE m2_i2 /* no. of entries */
501 /* Field names for SYS_KILL, SYS_SIGCTL */
502 #define SIG_REQUEST m2_l2 /* PM signal control request */
503 #define S_GETSIG 0 /* get pending kernel signal */
504 #define S_ENDSIG 1 /* finish a kernel signal */
505 #define S_SENDSIG 2 /* POSIX style signal handling */
506 #define S_SIGRETURN 3 /* return from POSIX handling */
507 #define S_KILL 4 /* servers kills process with signal */
508 #define SIG_ENDPT m2_i1 /* process number for inform */
509 #define SIG_NUMBER m2_i2 /* signal number to send */
510 #define SIG_FLAGS m2_i3 /* signal flags field */
511 #define SIG_MAP m2_l1 /* used by kernel to pass signal bit map */
512 #define SIG_CTXT_PTR m2_p1 /* pointer to info to restore signal context */
514 /* Field names for SYS_FORK, _EXEC, _EXIT, _NEWMAP. */
515 #define PR_ENDPT m1_i1 /* indicates a process */
516 #define PR_PRIORITY m1_i2 /* process priority */
517 #define PR_SLOT m1_i2 /* indicates a process slot */
518 #define PR_PID m1_i3 /* process id at process manager */
519 #define PR_STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
520 #define PR_TRACING m1_i3 /* flag to indicate tracing is on/ off */
521 #define PR_NAME_PTR m1_p2 /* tells where program name is for dmp */
522 #define PR_IP_PTR m1_p3 /* initial value for ip after exec */
523 #define PR_MEM_PTR m1_p1 /* tells where memory map is for sys_newmap
524 * and sys_fork
526 #define PR_FORK_FLAGS m1_i3
527 #define PR_FORK_MSGADDR m1_p1
529 /* Field names for SYS_INT86 */
530 #define INT86_REG86 m1_p1 /* pointer to registers */
532 /* Flags for PR_FORK_FLAGS. */
533 #define PFF_VMINHIBIT 0x01 /* Don't schedule until release by VM. */
535 /* Field names for SYS_SAFECOPY* */
536 #define SCP_FROM_TO m2_i1 /* from/to whom? */
537 #define SCP_INFO m2_i2 /* byte: DDDDSSSS Dest and Src seg */
538 #define SCP_GID m2_i3 /* grant id */
539 #define SCP_OFFSET m2_l1 /* offset within grant */
540 #define SCP_ADDRESS m2_p1 /* my own address */
541 #define SCP_BYTES m2_l2 /* bytes from offset */
543 /* Field names for SYS_VSAFECOPY* */
544 #define VSCP_VEC_ADDR m2_p1 /* start of vector */
545 #define VSCP_VEC_SIZE m2_l2 /* elements in vector */
547 /* For the SCP_INFO field: encoding and decoding. */
548 #define SCP_MAKEINFO(seg) ((seg) & 0xffff)
549 #define SCP_INFO2SEG(info) ((info) & 0xffff)
551 /* Field names for SELECT (FS). */
552 #define SEL_NFDS m8_i1
553 #define SEL_READFDS m8_p1
554 #define SEL_WRITEFDS m8_p2
555 #define SEL_ERRORFDS m8_p3
556 #define SEL_TIMEOUT m8_p4
558 /* Field names for SYS_SPROF, _CPROF, _PROFBUF. */
559 #define PROF_ACTION m7_i1 /* start/stop/reset/get */
560 #define PROF_MEM_SIZE m7_i2 /* available memory for data */
561 #define PROF_FREQ m7_i3 /* sample frequency */
562 #define PROF_ENDPT m7_i4 /* endpoint of caller */
563 #define PROF_CTL_PTR m7_p1 /* location of info struct */
564 #define PROF_MEM_PTR m7_p2 /* location of profiling data */
566 /* Field names for GETSYSINFO_UP (PM). */
567 #define SIU_WHAT m2_i1
568 #define SIU_LEN m2_i2
569 #define SIU_WHERE m2_p1
571 /* Message for SYS_READBIOS */
572 #define RDB_SIZE m2_i1
573 #define RDB_ADDR m2_l1
574 #define RDB_BUF m2_p1
576 /* Field names for SYS_VMCTL. */
577 #define SVMCTL_WHO m1_i1
578 #define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */
579 #define SVMCTL_VALUE m1_i3
580 #define SVMCTL_PF_WHO m1_i1 /* GET_PAGEFAULT reply: process ep */
581 #define SVMCTL_PF_I386_CR2 m1_i2 /* GET_PAGEFAULT reply: CR2 */
582 #define SVMCTL_PF_I386_ERR m1_i3 /* GET_PAGEFAULT reply: error code */
583 #define SVMCTL_MRG_ADDR m1_p1 /* MEMREQ_GET reply: address */
584 #define SVMCTL_MRG_LEN m1_i1 /* MEMREQ_GET reply: length */
585 #define SVMCTL_MRG_WRITE m1_i2 /* MEMREQ_GET reply: writeflag */
586 #define SVMCTL_MRG_EP m1_i3 /* MEMREQ_GET reply: process */
587 #define SVMCTL_MRG_REQUESTOR m1_p2 /* MEMREQ_GET reply: requestor */
589 /* Codes and field names for SYS_SYSCTL. */
590 #define SYSCTL_CODE m1_i1 /* SYSCTL_CODE_* below */
591 #define SYSCTL_ARG1 m1_p1
592 #define SYSCTL_ARG2 m1_i2
593 #define SYSCTL_CODE_DIAG 1 /* Print diagnostics. */
594 #define SYSCTL_CODE_STACKTRACE 2 /* Print process stack. */
595 #define DIAG_BUFSIZE (80*25)
597 /* Values for SVMCTL_PARAM. */
598 #define VMCTL_I386_SETCR3 10
599 #define VMCTL_GET_PAGEFAULT 11
600 #define VMCTL_CLEAR_PAGEFAULT 12
601 #define VMCTL_I386_GETCR3 13
602 #define VMCTL_MEMREQ_GET 14
603 #define VMCTL_MEMREQ_REPLY 15
604 #define VMCTL_INCSP 16
605 #define VMCTL_NOPAGEZERO 18
606 #define VMCTL_I386_KERNELLIMIT 19
607 #define VMCTL_I386_PAGEDIRS 20
608 #define VMCTL_I386_FREEPDE 23
609 #define VMCTL_ENABLE_PAGING 24
610 #define VMCTL_I386_INVLPG 25
611 #define VMCTL_FLUSHTLB 26
613 /* Field names for SYS_VTIMER. */
614 #define VT_WHICH m2_i1 /* which timer to set/retrieve */
615 # define VT_VIRTUAL 1 /* the ITIMER_VIRTUAL timer */
616 # define VT_PROF 2 /* the ITIMER_PROF timer */
617 #define VT_SET m2_i2 /* 1 for setting a timer, 0 retrieval only */
618 #define VT_VALUE m2_l1 /* new/previous value of the timer */
619 #define VT_ENDPT m2_l2 /* process to set/retrieve the timer for */
621 /*===========================================================================*
622 * Messages for the Reincarnation Server *
623 *===========================================================================*/
625 #define RS_RQ_BASE 0x700
627 #define RS_UP (RS_RQ_BASE + 0) /* start system service */
628 #define RS_DOWN (RS_RQ_BASE + 1) /* stop system service */
629 #define RS_REFRESH (RS_RQ_BASE + 2) /* refresh system service */
630 #define RS_RESTART (RS_RQ_BASE + 3) /* restart system service */
631 #define RS_SHUTDOWN (RS_RQ_BASE + 5) /* alert about shutdown */
632 #define RS_UP_COPY (RS_RQ_BASE + 6) /* start system service and
633 * keep the binary in memory
635 #define RS_START (RS_RQ_BASE + 7) /* start a driver/service
636 * arguments are passed in
637 * a struct rs_start
639 #define RS_LOOKUP (DS_RQ_BASE + 8) /* lookup server name */
641 # define RS_CMD_ADDR m1_p1 /* command string */
642 # define RS_CMD_LEN m1_i1 /* length of command */
643 # define RS_PERIOD m1_i2 /* heartbeat period */
644 # define RS_DEV_MAJOR m1_i3 /* major device number */
646 # define RS_ENDPOINT m1_i1 /* endpoint number in reply */
648 # define RS_NAME m1_p1 /* name */
649 # define RS_NAME_LEN m1_i1 /* namelen */
651 /*===========================================================================*
652 * Messages for the Data Store Server *
653 *===========================================================================*/
655 #define DS_RQ_BASE 0x800
657 #define DS_PUBLISH (DS_RQ_BASE + 0) /* publish information */
658 #define DS_SUBSCRIBE (DS_RQ_BASE + 1) /* subscribe to information */
659 #define DS_RETRIEVE (DS_RQ_BASE + 2) /* retrieve information by name */
660 #define DS_CHECK (DS_RQ_BASE + 3) /* retrieve updated information */
662 /* DS field names: DS_SUBSCRIBE, DS_PUBLISH, DS_RETRIEVE */
663 # define DS_KEY_GRANT m2_p1 /* key for the information */
664 # define DS_KEY_LEN m2_i1 /* length of key incl. '\0' */
665 # define DS_FLAGS m2_i2 /* flags provided by caller */
667 /* DS_PUBLISH, DS_RETRIEVE */
668 # define DS_VAL m2_l1 /* data (u32, char *, etc.) */
669 # define DS_VAL_LEN m2_l2 /* data length */
671 /*===========================================================================*
672 * Miscellaneous messages used by TTY *
673 *===========================================================================*/
675 /* Miscellaneous request types and field names, e.g. used by IS server. */
676 #define FKEY_CONTROL 98 /* control a function key at the TTY */
677 # define FKEY_REQUEST m2_i1 /* request to perform at TTY */
678 # define FKEY_MAP 10 /* observe function key */
679 # define FKEY_UNMAP 11 /* stop observing function key */
680 # define FKEY_EVENTS 12 /* request open key presses */
681 # define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */
682 # define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */
683 #define DIAG_BASE 0xa00
684 #define DIAGNOSTICS_OLD (DIAG_BASE+1) /* output a string without FS in between */
685 #define DIAGNOSTICS_S_OLD (DIAG_BASE+2) /* grant-based version of DIAGNOSTICS */
686 # define DIAG_PRINT_BUF_G m1_p1
687 # define DIAG_BUF_COUNT m1_i1
688 #define GET_KMESS (DIAG_BASE+3) /* get kmess from TTY */
689 # define GETKM_PTR m1_p1
690 #define GET_KMESS_S (DIAG_BASE+4) /* get kmess from TTY */
691 # define GETKM_GRANT m1_i1
692 #define ASYN_DIAGNOSTICS_OLD (DIAG_BASE+5) /* grant-based, replyless DIAGNOSTICS */
694 #define DIAG_REPL_OLD (DIAG_BASE+0x80+0) /* reply to DIAGNOSTICS(_S) */
696 #define PM_BASE 0x900
697 #define PM_GET_WORK (PM_BASE + 1) /* Get work from PM */
698 #define PM_IDLE (PM_BASE + 2) /* PM doesn't have any more work */
699 #define PM_BUSY (PM_BASE + 3) /* A reply from FS is needed */
700 #define PM_SETSID (PM_BASE + 5) /* Tell FS about the session leader */
701 #define PM_SETSID_PROC m1_i1 /* process */
702 #define PM_SETGID (PM_BASE + 6) /* Tell FS about the new group IDs */
703 #define PM_SETGID_PROC m1_i1 /* process */
704 #define PM_SETGID_EGID m1_i2 /* effective group id */
705 #define PM_SETGID_RGID m1_i3 /* real group id */
706 #define PM_SETUID (PM_BASE + 7) /* Tell FS about the new user IDs */
707 #define PM_SETUID_PROC m1_i1 /* process */
708 #define PM_SETUID_EGID m1_i2 /* effective user id */
709 #define PM_SETUID_RGID m1_i3 /* real user id */
710 #define PM_FORK (PM_BASE + 8) /* Tell FS about the new process */
711 #define PM_FORK_PPROC m1_i1 /* parent process */
712 #define PM_FORK_CPROC m1_i2 /* child process */
713 #define PM_FORK_CPID m1_i3 /* child pid */
714 #define PM_EXIT (PM_BASE + 9) /* Tell FS about the exiting process */
715 #define PM_EXIT_PROC m1_i1 /* process */
716 #define PM_UNPAUSE (PM_BASE + 10) /* interrupted process */
717 #define PM_UNPAUSE_PROC m1_i1 /* process */
718 #define PM_REBOOT (PM_BASE + 11) /* Tell FS that we about to reboot */
719 #define PM_EXEC (PM_BASE + 12) /* Forward exec call to FS */
720 #define PM_EXEC_PROC m1_i1 /* process */
721 #define PM_EXEC_PATH m1_p1 /* executable */
722 #define PM_EXEC_PATH_LEN m1_i2 /* length of path including
723 * terminating nul
725 #define PM_EXEC_FRAME m1_p2 /* arguments and environment */
726 #define PM_EXEC_FRAME_LEN m1_i3 /* size of frame */
727 #define PM_FORK_NB (PM_BASE + 13) /* Tell FS about the fork_nb call */
728 #define PM_DUMPCORE (PM_BASE + 14) /* Ask FS to generate a core dump */
729 #define PM_CORE_PROC m1_i1
730 #define PM_CORE_SEGPTR m1_p1
731 #define PM_UNPAUSE_TR (PM_BASE + 15) /* interrupted process (for tracing) */
733 /* Replies */
734 #define PM_EXIT_REPLY (PM_BASE + 20) /* Reply from FS */
735 #define PM_REBOOT_REPLY (PM_BASE + 21) /* Reply from FS */
736 #define PM_EXEC_REPLY (PM_BASE + 22) /* Reply from FS */
737 /* PM_EXEC_PROC m1_i1 */
738 #define PM_EXEC_STATUS m1_i2 /* OK or failure */
739 #define PM_CORE_REPLY (PM_BASE + 23) /* Reply from FS */
740 /* PM_CORE_PROC m1_i1 */
741 #define PM_CORE_STATUS m1_i2 /* OK or failure */
743 /* Parameters for the EXEC_NEWMEM call */
744 #define EXC_NM_PROC m1_i1 /* process that needs new map */
745 #define EXC_NM_PTR m1_p1 /* parameters in struct exec_newmem */
746 /* Results:
747 * the status will be in m_type.
748 * the top of the stack will be in m1_i1.
749 * the following flags will be in m1_i2:
751 #define EXC_NM_RF_LOAD_TEXT 1 /* Load text segment (otherwise the
752 * text segment is already present)
754 #define EXC_NM_RF_ALLOW_SETUID 2 /* Setuid execution is allowed (tells
755 * FS to update its uid and gid
756 * fields.
758 #define EXC_NM_RF_FULLVM 4
760 /* Parameters for the EXEC_RESTART call */
761 #define EXC_RS_PROC m1_i1 /* process that needs to be restarted */
762 #define EXC_RS_RESULT m1_i2 /* result of the exec */
764 #define VFS_BASE 0xA00 /* Requests sent by VFS to filesystem
765 * implementations. See <minix/vfsif.h>
768 /* Requests sent by VM to VFS, done on behalf of a user process. */
769 #define VM_VFS_BASE 0xB00
770 #define VM_VFS_OPEN (VM_VFS_BASE+0) /* open() on behalf of user process. */
771 # define VMVO_NAME_GRANT m2_i1 /* 0-terminated */
772 # define VMVO_NAME_LENGTH m2_i2 /* name length including 0 */
773 # define VMVO_FLAGS m2_i3
774 # define VMVO_MODE m2_l1
775 # define VMVO_ENDPOINT m2_l2
776 #define VM_VFS_MMAP (VM_VFS_BASE+1) /* mmap() */
777 #define VM_VFS_CLOSE (VM_VFS_BASE+2) /* close() */
778 # define VMVC_FD m1_i1
779 # define VMVC_ENDPOINT m1_i2
781 /* PM field names */
782 /* BRK */
783 #define PMBRK_ADDR m1_p1
785 /* TRACE */
786 #define PMTRACE_ADDR m2_l1
788 #define PM_ENDPT m1_i1
789 #define PM_PENDPT m1_i2
791 /*===========================================================================*
792 * Messages for VM server *
793 *===========================================================================*/
794 #define VM_RQ_BASE 0xC00
796 /* Calls from PM */
797 #define VM_EXIT (VM_RQ_BASE+0)
798 # define VME_ENDPOINT m1_i1
799 #define VM_FORK (VM_RQ_BASE+1)
800 # define VMF_ENDPOINT m1_i1
801 # define VMF_SLOTNO m1_i2
802 # define VMF_CHILD_ENDPOINT m1_i3 /* result */
803 #define VM_BRK (VM_RQ_BASE+2)
804 # define VMB_ENDPOINT m1_i1
805 # define VMB_ADDR m1_p1
806 # define VMB_RETADDR m1_p2 /* result */
807 #define VM_EXEC_NEWMEM (VM_RQ_BASE+3)
808 # define VMEN_ENDPOINT m1_i1
809 # define VMEN_ARGSPTR m1_p1
810 # define VMEN_ARGSSIZE m1_i2
811 # define VMEN_FLAGS m1_i3 /* result */
812 # define VMEN_STACK_TOP m1_p2 /* result */
813 #define VM_PUSH_SIG (VM_RQ_BASE+4)
814 # define VMPS_ENDPOINT m1_i1
815 # define VMPS_OLD_SP m1_p1 /* result */
816 #define VM_WILLEXIT (VM_RQ_BASE+5)
817 # define VMWE_ENDPOINT m1_i1
819 /* General calls. */
820 #define VM_MMAP (VM_RQ_BASE+10)
821 # define VMM_ADDR m5_l1
822 # define VMM_LEN m5_l2
823 # define VMM_PROT m5_c1
824 # define VMM_FLAGS m5_c2
825 # define VMM_FD m5_i1
826 # define VMM_OFFSET m5_i2
827 # define VMM_RETADDR m5_l1 /* result */
828 #define VM_UMAP (VM_RQ_BASE+11)
829 # define VMU_SEG m1_i1
830 # define VMU_OFFSET m1_p1
831 # define VMU_LENGTH m1_p2
832 # define VMU_RETADDR m1_p3
834 /* to VM: inform VM about a region of memory that is used for
835 * bus-master DMA
837 #define VM_ADDDMA (VM_RQ_BASE+12)
838 # define VMAD_REQ m2_i2
839 # define VMAD_EP m2_i1
840 # define VMAD_START m2_l1
841 # define VMAD_SIZE m2_l2
843 /* to VM: inform VM that a region of memory that is no longer
844 * used for bus-master DMA
846 #define VM_DELDMA (VM_RQ_BASE+13)
847 # define VMDD_REQ m2_i2
848 # define VMDD_EP m2_i1
849 # define VMDD_START m2_l1
850 # define VMDD_SIZE m2_l2
852 /* to VM: ask VM for a region of memory that should not
853 * be used for bus-master DMA any longer
855 #define VM_GETDMA (VM_RQ_BASE+14)
856 # define VMGD_REQ m2_i2
857 # define VMGD_PROCP m2_i1
858 # define VMGD_BASEP m2_l1
859 # define VMGD_SIZEP m2_l2
861 #define VM_MAP_PHYS (VM_RQ_BASE+15)
862 # define VMMP_EP m1_i1
863 # define VMMP_PHADDR m1_p2
864 # define VMMP_LEN m1_i2
865 # define VMMP_VADDR_REPLY m1_p3
867 #define VM_UNMAP_PHYS (VM_RQ_BASE+16)
868 # define VMUP_EP m1_i1
869 # define VMUP_VADDR m1_p1
871 #define VM_MUNMAP (VM_RQ_BASE+17)
872 # define VMUM_ADDR m1_p1
873 # define VMUM_LEN m1_i1
875 #define VM_ALLOCMEM (VM_RQ_BASE+18)
876 # define VMAM_BYTES m1_p1
877 # define VMAM_MEMBASE m1_i1
879 #define VM_MUNMAP_TEXT (VM_RQ_BASE+19)
881 /* Calls from VFS. */
882 # define VMV_ENDPOINT m1_i1 /* for all VM_VFS_REPLY_* */
883 #define VM_VFS_REPLY_OPEN (VM_RQ_BASE+30)
884 # define VMVRO_FD m1_i2
885 #define VM_VFS_REPLY_MMAP (VM_RQ_BASE+31)
886 #define VM_VFS_REPLY_CLOSE (VM_RQ_BASE+32)
888 #define VM_REMAP (VM_RQ_BASE+33)
889 # define VMRE_D m1_i1
890 # define VMRE_S m1_i2
891 # define VMRE_DA m1_p1
892 # define VMRE_SA m1_p2
893 # define VMRE_RETA m1_p3
894 # define VMRE_SIZE m1_i3
896 #define VM_SHM_UNMAP (VM_RQ_BASE+34)
897 # define VMUN_ENDPT m2_i1
898 # define VMUN_ADDR m2_l1
900 #define VM_GETPHYS (VM_RQ_BASE+35)
901 # define VMPHYS_ENDPT m2_i1
902 # define VMPHYS_ADDR m2_l1
903 # define VMPHYS_RETA m2_l2
905 #define VM_GETREF (VM_RQ_BASE+36)
906 # define VMREFCNT_ENDPT m2_i1
907 # define VMREFCNT_ADDR m2_l1
908 # define VMREFCNT_RETC m2_i2
910 #define VM_RS_SET_PRIV (VM_RQ_BASE+37)
911 # define VM_RS_NR m2_i1
912 # define VM_RS_BUF m2_l1
914 #define VM_QUERY_EXIT (VM_RQ_BASE+38)
915 # define VM_QUERY_RET_PT m2_i1
916 # define VM_QUERY_IS_MORE m2_i2
918 #define VM_NOTIFY_SIG (VM_RQ_BASE+39)
919 # define VM_NOTIFY_SIG_ENDPOINT m1_i1
920 # define VM_NOTIFY_SIG_IPC m1_i2
922 #define VM_CTL (VM_RQ_BASE+40)
923 #define VCTL_WHAT m1_i1
924 #define VCTL_PARAM m1_i2
926 /* VCTL_PARAMs */
927 #define VCTLP_STATS_MEM 1
928 #define VCTLP_STATS_EP 2
930 /* Total. */
931 #define VM_NCALLS 41
933 /*===========================================================================*
934 * Messages for IPC server *
935 *===========================================================================*/
936 #define IPC_BASE 0xD00
938 /* Shared Memory */
939 #define IPC_SHMGET (IPC_BASE+1)
940 # define SHMGET_KEY m2_l1
941 # define SHMGET_SIZE m2_l2
942 # define SHMGET_FLAG m2_i1
943 # define SHMGET_RETID m2_i2
944 #define IPC_SHMAT (IPC_BASE+2)
945 # define SHMAT_ID m2_i1
946 # define SHMAT_ADDR m2_l1
947 # define SHMAT_FLAG m2_i2
948 # define SHMAT_RETADDR m2_l2
949 #define IPC_SHMDT (IPC_BASE+3)
950 # define SHMDT_ADDR m2_l1
951 #define IPC_SHMCTL (IPC_BASE+4)
952 # define SHMCTL_ID m2_i1
953 # define SHMCTL_CMD m2_i2
954 # define SHMCTL_BUF m2_l1
955 # define SHMCTL_RET m2_i3
957 /* Semaphore */
958 #define IPC_SEMGET (IPC_BASE+5)
959 # define SEMGET_KEY m2_l1
960 # define SEMGET_NR m2_i1
961 # define SEMGET_FLAG m2_i2
962 # define SEMGET_RETID m2_i3
963 #define IPC_SEMCTL (IPC_BASE+6)
964 # define SEMCTL_ID m2_i1
965 # define SEMCTL_NUM m2_i2
966 # define SEMCTL_CMD m2_i3
967 # define SEMCTL_OPT m2_l1
968 #define IPC_SEMOP (IPC_BASE+7)
969 # define SEMOP_ID m2_i1
970 # define SEMOP_OPS m2_l1
971 # define SEMOP_SIZE m2_i2
973 #endif /* _MINIX_COM_H */