1 /* This file defines constants for use in message communication (mostly)
2 * between system processes.
4 * A number of protocol message request and response types are defined. For
5 * debugging purposes, each protocol is assigned its own unique number range.
6 * The following such message type ranges have been allocated:
8 * 1 - 0xFF POSIX requests (see callnr.h)
9 * 0x200 - 0x2FF Data link layer requests and responses
10 * 0x300 - 0x3FF Bus controller requests and responses
11 * 0x400 - 0x4FF Block and character device requests
12 * 0x500 - 0x5FF Block and character device responses
13 * 0x600 - 0x6FF Kernel calls to SYSTEM task
14 * 0x700 - 0x7FF Reincarnation Server (RS) requests
15 * 0x800 - 0x8FF Data Store (DS) requests
16 * 0x900 - 0x9FF Requests from PM to VFS, and responses
17 * (0xA00 - 0xAFF old TTY and LOG requests, being phased out)
18 * 0xA00 - 0xAFF Requests from VFS to file systems (see vfsif.h)
19 * 0xB00 - 0xBFF Requests from VM to VFS
20 * 0xC00 - 0xCFF Virtual Memory (VM) requests
21 * 0xD00 - 0xDFF IPC server requests
22 * 0xE00 - 0xEFF Common system messages (e.g. system signals)
23 * 0xF00 - 0xFFF Scheduling messages
24 * 0x1000 - 0x10FF Notify messages
26 * Zero and negative values are widely used for OK and error responses.
32 /*===========================================================================*
33 * Magic process numbers *
34 *===========================================================================*/
36 /* These may not be any valid endpoint (see <minix/endpoint.h>). */
37 #define ANY ((endpoint_t) 0x7ace) /* used to indicate 'any process' */
38 #define NONE ((endpoint_t) 0x6ace) /* used to indicate 'no process at all' */
39 #define SELF ((endpoint_t) 0x8ace) /* used to indicate 'own process' */
40 #define _MAX_MAGIC_PROC (SELF) /* used by <minix/endpoint.h>
41 to determine generation size */
43 /*===========================================================================*
44 * Process numbers of processes in the system image *
45 *===========================================================================*/
47 /* The values of several task numbers depend on whether they or other tasks
48 * are enabled. They are defined as (PREVIOUS_TASK - ENABLE_TASK) in general.
49 * ENABLE_TASK is either 0 or 1, so a task either gets a new number, or gets
50 * the same number as the previous task and is further unused. Note that the
51 * order should correspond to the order in the task table defined in table.c.
54 /* Kernel tasks. These all run in the same address space. */
55 #define IDLE ((endpoint_t) -4) /* runs when no one else can run */
56 #define CLOCK ((endpoint_t) -3) /* alarms and other clock functions */
57 #define SYSTEM ((endpoint_t) -2) /* request system functionality */
58 #define KERNEL ((endpoint_t) -1) /* pseudo-process for IPC and scheduling */
59 #define HARDWARE KERNEL /* for hardware interrupt handlers */
61 /* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */
62 #define MAX_NR_TASKS 1023
65 /* User-space processes, that is, device drivers, servers, and INIT. */
66 #define PM_PROC_NR ((endpoint_t) 0) /* process manager */
67 #define FS_PROC_NR ((endpoint_t) 1) /* file system */
68 #define VFS_PROC_NR FS_PROC_NR /* FS has been renamed to VFS. */
69 #define RS_PROC_NR ((endpoint_t) 2) /* reincarnation server */
70 #define MEM_PROC_NR ((endpoint_t) 3) /* memory driver (RAM disk, null, etc.) */
71 #define LOG_PROC_NR ((endpoint_t) 4) /* log device driver */
72 #define TTY_PROC_NR ((endpoint_t) 5) /* terminal (TTY) driver */
73 #define DS_PROC_NR ((endpoint_t) 6) /* data store server */
74 #define MFS_PROC_NR ((endpoint_t) 7) /* minix root filesystem */
75 #define VM_PROC_NR ((endpoint_t) 8) /* memory server */
76 #define PFS_PROC_NR ((endpoint_t) 9) /* pipe filesystem */
77 #define SCHED_PROC_NR ((endpoint_t) 10) /* scheduler */
78 #define LAST_SPECIAL_PROC_NR 11 /* An untyped version for
79 computation in macros.*/
80 #define INIT_PROC_NR ((endpoint_t) LAST_SPECIAL_PROC_NR) /* init
83 /* Root system process and root user process. */
84 #define ROOT_SYS_PROC_NR RS_PROC_NR
85 #define ROOT_USR_PROC_NR INIT_PROC_NR
87 /* Number of processes contained in the system image. */
88 #define NR_BOOT_PROCS (NR_TASKS + LAST_SPECIAL_PROC_NR + 1)
90 /*===========================================================================*
91 * Kernel notification types *
92 *===========================================================================*/
94 /* Kernel notification types. In principle, these can be sent to any process,
95 * so make sure that these types do not interfere with other message types.
96 * Notifications are prioritized because of the way they are unhold() and
97 * blocking notifications are delivered. The lowest numbers go first. The
98 * offset are used for the per-process notification bit maps.
100 #define NOTIFY_MESSAGE 0x1000
101 /* FIXME the old is_notify(a) should be replaced by is_ipc_notify(status). */
102 #define is_ipc_notify(ipc_status) (IPC_STATUS_CALL(ipc_status) == NOTIFY)
103 #define is_notify(a) ((unsigned) ((a) - NOTIFY_MESSAGE) < 0x100)
104 #define is_ipc_asynch(ipc_status) \
105 (is_ipc_notify(ipc_status) || IPC_STATUS_CALL(ipc_status) == SENDA)
106 #define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS))
108 /* Shorthands for message parameters passed with notifications. */
109 #define NOTIFY_ARG m2_l1
110 #define NOTIFY_TIMESTAMP m2_l2
112 /*===========================================================================*
113 * Messages for BUS controller drivers *
114 *===========================================================================*/
115 #define BUSC_RQ_BASE 0x300 /* base for request types */
116 #define BUSC_RS_BASE 0x380 /* base for response types */
118 #define BUSC_PCI_INIT (BUSC_RQ_BASE + 0) /* First message to
121 #define BUSC_PCI_FIRST_DEV (BUSC_RQ_BASE + 1) /* Get index (and
125 #define BUSC_PCI_NEXT_DEV (BUSC_RQ_BASE + 2) /* Get index (and
129 #define BUSC_PCI_FIND_DEV (BUSC_RQ_BASE + 3) /* Get index of a
130 * PCI device based on
133 #define BUSC_PCI_IDS (BUSC_RQ_BASE + 4) /* Get vid/did from an
136 #define BUSC_PCI_DEV_NAME (BUSC_RQ_BASE + 5) /* Get the name of a
139 #define BUSC_PCI_SLOT_NAME (BUSC_RQ_BASE + 6) /* Get the name of a
142 #define BUSC_PCI_RESERVE (BUSC_RQ_BASE + 7) /* Reserve a PCI dev */
143 #define BUSC_PCI_ATTR_R8 (BUSC_RQ_BASE + 8) /* Read 8-bit
146 #define BUSC_PCI_ATTR_R16 (BUSC_RQ_BASE + 9) /* Read 16-bit
149 #define BUSC_PCI_ATTR_R32 (BUSC_RQ_BASE + 10) /* Read 32-bit
152 #define BUSC_PCI_ATTR_W8 (BUSC_RQ_BASE + 11) /* Write 8-bit
155 #define BUSC_PCI_ATTR_W16 (BUSC_RQ_BASE + 12) /* Write 16-bit
158 #define BUSC_PCI_ATTR_W32 (BUSC_RQ_BASE + 13) /* Write 32-bit
161 #define BUSC_PCI_RESCAN (BUSC_RQ_BASE + 14) /* Rescan bus */
162 #define BUSC_PCI_DEV_NAME_S (BUSC_RQ_BASE + 15) /* Get the name of a
166 #define BUSC_PCI_SLOT_NAME_S (BUSC_RQ_BASE + 16) /* Get the name of a
167 * PCI slot (safecopy)
169 #define BUSC_PCI_SET_ACL (BUSC_RQ_BASE + 17) /* Set the ACL for a
172 #define BUSC_PCI_DEL_ACL (BUSC_RQ_BASE + 18) /* Delete the ACL of a
175 #define IOMMU_MAP (BUSC_RQ_BASE + 32) /* Ask IOMMU to map
176 * a segment of memory
181 /*===========================================================================*
182 * Messages for BLOCK and CHARACTER device drivers *
183 *===========================================================================*/
185 /* Message types for device drivers. */
186 #define DEV_RQ_BASE 0x400 /* base for device request types */
187 #define DEV_RS_BASE 0x500 /* base for device response types */
189 #define CANCEL (DEV_RQ_BASE + 0) /* force a task to cancel */
190 #define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */
191 #define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */
192 #define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */
193 #define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */
194 #define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */
195 #define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */
196 #define DEV_REOPEN (DEV_RQ_BASE + 14) /* reopen a minor device */
198 #define DEV_READ_S (DEV_RQ_BASE + 20) /* (safecopy) read from minor */
199 #define DEV_WRITE_S (DEV_RQ_BASE + 21) /* (safecopy) write to minor */
200 #define DEV_SCATTER_S (DEV_RQ_BASE + 22) /* (safecopy) write from a vector */
201 #define DEV_GATHER_S (DEV_RQ_BASE + 23) /* (safecopy) read into a vector */
202 #define DEV_IOCTL_S (DEV_RQ_BASE + 24) /* (safecopy) I/O control code */
203 #define DEV_MMAP_S (DEV_RQ_BASE + 25) /* (safecopy) mmap interface */
205 #define IS_DEV_RQ(type) (((type) & ~0xff) == DEV_RQ_BASE)
207 #define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */
208 #define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */
209 #define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */
210 #define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */
211 #define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply */
212 #define DEV_REOPEN_REPL (DEV_RS_BASE + 5) /* reply to DEV_REOPEN */
213 #define DEV_CLOSE_REPL (DEV_RS_BASE + 6) /* reply to DEV_CLOSE */
214 #define DEV_SEL_REPL1 (DEV_RS_BASE + 7) /* first reply to DEV_SELECT */
215 #define DEV_SEL_REPL2 (DEV_RS_BASE + 8) /* (opt) second reply to DEV_SELECT */
217 #define IS_DEV_RS(type) (((type) & ~0xff) == DEV_RS_BASE)
219 /* Field names for messages to block and character device drivers. */
220 #define DEVICE m2_i1 /* major-minor device */
221 #define IO_ENDPT m2_i2 /* which (proc/endpoint) wants I/O? */
222 #define COUNT m2_i3 /* how many bytes to transfer */
223 #define REQUEST m2_i3 /* ioctl request code */
224 #define POSITION m2_l1 /* file offset (low 4 bytes) */
225 #define HIGHPOS m2_l2 /* file offset (high 4 bytes) */
226 #define ADDRESS m2_p1 /* core buffer address */
227 #define IO_GRANT m2_p1 /* grant id (for DEV_*_S variants) */
229 /* Field names for DEV_SELECT messages to device drivers. */
230 #define DEV_MINOR m2_i1 /* minor device */
231 #define DEV_SEL_OPS m2_i2 /* which select operations are requested */
233 /* Field names used in reply messages from tasks. */
234 #define REP_ENDPT m2_i1 /* # of proc on whose behalf I/O was done */
235 #define REP_STATUS m2_i2 /* bytes transferred or error number */
236 #define REP_IO_GRANT m2_i3 /* DEV_REVIVE: grant by which I/O was done */
237 # define SUSPEND -998 /* status to suspend caller, reply later */
239 /* Field names for messages to TTY driver. */
240 #define TTY_LINE DEVICE /* message parameter: terminal line */
241 #define TTY_REQUEST COUNT /* message parameter: ioctl request code */
242 #define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */
243 #define TTY_PGRP m2_i3 /* message parameter: process group */
245 /* Field names for the QIC 02 status reply from tape driver */
246 #define TAPE_STAT0 m2_l1
247 #define TAPE_STAT1 m2_l2
249 /*===========================================================================*
250 * Messages for networking layer *
251 *===========================================================================*/
253 /* Message types for network layer requests. This layer acts like a driver. */
254 #define NW_OPEN DEV_OPEN
255 #define NW_CLOSE DEV_CLOSE
256 #define NW_READ DEV_READ
257 #define NW_WRITE DEV_WRITE
258 #define NW_IOCTL DEV_IOCTL
259 #define NW_CANCEL CANCEL
261 /* Base type for data link layer requests and responses. */
262 #define DL_RQ_BASE 0x200
263 #define DL_RS_BASE 0x280
265 /* Message types for data link layer requests. */
266 #define DL_CONF (DL_RQ_BASE + 0)
267 #define DL_GETSTAT_S (DL_RQ_BASE + 1)
268 #define DL_WRITEV_S (DL_RQ_BASE + 2)
269 #define DL_READV_S (DL_RQ_BASE + 3)
271 /* Message type for data link layer replies. */
272 #define DL_CONF_REPLY (DL_RS_BASE + 0)
273 #define DL_STAT_REPLY (DL_RS_BASE + 1)
274 #define DL_TASK_REPLY (DL_RS_BASE + 2)
276 /* Field names for data link layer messages. */
277 #define DL_ENDPT m2_i2
278 #define DL_COUNT m2_i3
279 #define DL_MODE m2_l1
280 #define DL_FLAGS m2_l1
281 #define DL_GRANT m2_l2
282 #define DL_STAT m3_i1
283 #define DL_HWADDR m3_ca1
285 /* Bits in 'DL_FLAGS' field of DL replies. */
286 # define DL_NOFLAGS 0x00
287 # define DL_PACK_SEND 0x01
288 # define DL_PACK_RECV 0x02
290 /* Bits in 'DL_MODE' field of DL requests. */
291 # define DL_NOMODE 0x0
292 # define DL_PROMISC_REQ 0x1
293 # define DL_MULTI_REQ 0x2
294 # define DL_BROAD_REQ 0x4
296 /*===========================================================================*
297 * SYSTASK request types and field names *
298 *===========================================================================*/
300 /* System library calls are dispatched via a call vector, so be careful when
301 * modifying the system call numbers. The numbers here determine which call
302 * is made from the call vector.
304 #define KERNEL_CALL 0x600 /* base for kernel calls to SYSTEM */
306 # define SYS_FORK (KERNEL_CALL + 0) /* sys_fork() */
307 # define SYS_EXEC (KERNEL_CALL + 1) /* sys_exec() */
308 # define SYS_CLEAR (KERNEL_CALL + 2) /* sys_clear() */
309 # define SYS_SCHEDULE (KERNEL_CALL + 3) /* sys_schedule() */
310 # define SYS_PRIVCTL (KERNEL_CALL + 4) /* sys_privctl() */
311 # define SYS_TRACE (KERNEL_CALL + 5) /* sys_trace() */
312 # define SYS_KILL (KERNEL_CALL + 6) /* sys_kill() */
314 # define SYS_GETKSIG (KERNEL_CALL + 7) /* sys_getsig() */
315 # define SYS_ENDKSIG (KERNEL_CALL + 8) /* sys_endsig() */
316 # define SYS_SIGSEND (KERNEL_CALL + 9) /* sys_sigsend() */
317 # define SYS_SIGRETURN (KERNEL_CALL + 10) /* sys_sigreturn() */
319 # define SYS_NEWMAP (KERNEL_CALL + 11) /* sys_newmap() */
320 # define SYS_SEGCTL (KERNEL_CALL + 12) /* sys_segctl() */
321 # define SYS_MEMSET (KERNEL_CALL + 13) /* sys_memset() */
323 # define SYS_UMAP (KERNEL_CALL + 14) /* sys_umap() */
324 # define SYS_VIRCOPY (KERNEL_CALL + 15) /* sys_vircopy() */
325 # define SYS_PHYSCOPY (KERNEL_CALL + 16) /* sys_physcopy() */
327 # define SYS_IRQCTL (KERNEL_CALL + 19) /* sys_irqctl() */
328 # define SYS_INT86 (KERNEL_CALL + 20) /* sys_int86() */
329 # define SYS_DEVIO (KERNEL_CALL + 21) /* sys_devio() */
330 # define SYS_SDEVIO (KERNEL_CALL + 22) /* sys_sdevio() */
331 # define SYS_VDEVIO (KERNEL_CALL + 23) /* sys_vdevio() */
333 # define SYS_SETALARM (KERNEL_CALL + 24) /* sys_setalarm() */
334 # define SYS_TIMES (KERNEL_CALL + 25) /* sys_times() */
335 # define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */
336 # define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */
337 # define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
338 # define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
339 # define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
340 # define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */
341 # define SYS_SETGRANT (KERNEL_CALL + 34) /* sys_setgrant() */
342 # define SYS_READBIOS (KERNEL_CALL + 35) /* sys_readbios() */
344 # define SYS_SPROF (KERNEL_CALL + 36) /* sys_sprof() */
345 # define SYS_CPROF (KERNEL_CALL + 37) /* sys_cprof() */
346 # define SYS_PROFBUF (KERNEL_CALL + 38) /* sys_profbuf() */
348 # define SYS_STIME (KERNEL_CALL + 39) /* sys_stime() */
350 # define SYS_VMCTL (KERNEL_CALL + 43) /* sys_vmctl() */
351 # define SYS_SYSCTL (KERNEL_CALL + 44) /* sys_sysctl() */
353 # define SYS_VTIMER (KERNEL_CALL + 45) /* sys_vtimer() */
354 # define SYS_RUNCTL (KERNEL_CALL + 46) /* sys_runctl() */
355 # define SYS_SAFEMAP (KERNEL_CALL + 47) /* sys_safemap() */
356 # define SYS_SAFEREVMAP (KERNEL_CALL + 48) /* sys_saferevmap() sys_saferevmap2() */
357 # define SYS_SAFEUNMAP (KERNEL_CALL + 49) /* sys_safeunmap() */
358 # define SYS_GETMCONTEXT (KERNEL_CALL + 50) /* sys_getmcontext() */
359 # define SYS_SETMCONTEXT (KERNEL_CALL + 51) /* sys_setmcontext() */
361 # define SYS_UPDATE (KERNEL_CALL + 52) /* sys_update() */
362 # define SYS_EXIT (KERNEL_CALL + 53) /* sys_exit() */
364 # define SYS_SCHEDCTL (KERNEL_CALL + 54) /* sys_schedctl() */
365 # define SYS_STATECTL (KERNEL_CALL + 55) /* sys_statectl() */
368 #define NR_SYS_CALLS 56 /* number of kernel calls */
370 #define SYS_CALL_MASK_SIZE BITMAP_CHUNKS(NR_SYS_CALLS)
372 /* Basic kernel calls allowed to every system process. */
373 #define SYS_BASIC_CALLS \
374 SYS_EXIT, SYS_SAFECOPYFROM, SYS_SAFECOPYTO, SYS_VSAFECOPY, SYS_GETINFO, \
375 SYS_TIMES, SYS_SETALARM, SYS_SETGRANT, SYS_SAFEMAP, SYS_SAFEREVMAP, \
376 SYS_SAFEUNMAP, SYS_PROFBUF, SYS_SYSCTL, SYS_STATECTL
378 /* Field names for SYS_MEMSET. */
379 #define MEM_PTR m2_p1 /* base */
380 #define MEM_COUNT m2_l1 /* count */
381 #define MEM_PATTERN m2_l2 /* pattern to write */
383 /* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
384 #define DIO_REQUEST m2_i3 /* device in or output */
385 # define _DIO_INPUT 0x001
386 # define _DIO_OUTPUT 0x002
387 # define _DIO_DIRMASK 0x00f
388 # define _DIO_BYTE 0x010
389 # define _DIO_WORD 0x020
390 # define _DIO_LONG 0x030
391 # define _DIO_TYPEMASK 0x0f0
392 # define _DIO_SAFE 0x100
393 # define _DIO_SAFEMASK 0xf00
394 # define DIO_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE)
395 # define DIO_INPUT_WORD (_DIO_INPUT|_DIO_WORD)
396 # define DIO_INPUT_LONG (_DIO_INPUT|_DIO_LONG)
397 # define DIO_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE)
398 # define DIO_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD)
399 # define DIO_OUTPUT_LONG (_DIO_OUTPUT|_DIO_LONG)
400 # define DIO_SAFE_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE|_DIO_SAFE)
401 # define DIO_SAFE_INPUT_WORD (_DIO_INPUT|_DIO_WORD|_DIO_SAFE)
402 # define DIO_SAFE_INPUT_LONG (_DIO_INPUT|_DIO_LONG|_DIO_SAFE)
403 # define DIO_SAFE_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE|_DIO_SAFE)
404 # define DIO_SAFE_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD|_DIO_SAFE)
405 # define DIO_SAFE_OUTPUT_LONG (_DIO_OUTPUT|_DIO_LONG|_DIO_SAFE)
406 #define DIO_PORT m2_l1 /* single port address */
407 #define DIO_VALUE m2_l2 /* single I/O value */
408 #define DIO_VEC_ADDR m2_p1 /* address of buffer or (p,v)-pairs */
409 #define DIO_VEC_SIZE m2_l2 /* number of elements in vector */
410 #define DIO_VEC_ENDPT m2_i2 /* number of process where vector is */
411 #define DIO_OFFSET m2_i1 /* offset from grant */
413 /* Field names for SYS_SETALARM. */
414 #define ALRM_EXP_TIME m2_l1 /* expire time for the alarm call */
415 #define ALRM_ABS_TIME m2_i2 /* set to 1 to use absolute alarm time */
416 #define ALRM_TIME_LEFT m2_l1 /* how many ticks were remaining */
418 /* Field names for SYS_IRQCTL. */
419 #define IRQ_REQUEST m5_s1 /* what to do? */
420 # define IRQ_SETPOLICY 1 /* manage a slot of the IRQ table */
421 # define IRQ_RMPOLICY 2 /* remove a slot of the IRQ table */
422 # define IRQ_ENABLE 3 /* enable interrupts */
423 # define IRQ_DISABLE 4 /* disable interrupts */
424 #define IRQ_VECTOR m5_s2 /* irq vector */
425 #define IRQ_POLICY m5_i1 /* options for IRQCTL request */
426 # define IRQ_REENABLE 0x001 /* reenable IRQ line after interrupt */
427 # define IRQ_BYTE 0x100 /* byte values */
428 # define IRQ_WORD 0x200 /* word values */
429 # define IRQ_LONG 0x400 /* long values */
430 #define IRQ_HOOK_ID m5_l3 /* id of irq hook at kernel */
432 /* Field names for SYS_SEGCTL. */
433 #define SEG_SELECT m4_l1 /* segment selector returned */
434 #define SEG_OFFSET m4_l2 /* offset in segment returned */
435 #define SEG_PHYS m4_l3 /* physical address of segment */
436 #define SEG_SIZE m4_l4 /* segment size */
437 #define SEG_INDEX m4_l5 /* segment index in remote map */
439 /* Field names for SYS_ABORT. */
440 #define ABRT_HOW m1_i1 /* RBT_REBOOT, RBT_HALT, etc. */
441 #define ABRT_MON_ENDPT m1_i2 /* process where monitor params are */
442 #define ABRT_MON_LEN m1_i3 /* length of monitor params */
443 #define ABRT_MON_ADDR m1_p1 /* virtual address of monitor params */
445 /* Field names for _UMAP, _VIRCOPY, _PHYSCOPY. */
446 #define CP_SRC_SPACE m5_s1 /* T or D space (stack is also D) */
447 #define CP_SRC_ENDPT m5_i1 /* process to copy from */
448 #define CP_SRC_ADDR m5_l1 /* address where data come from */
449 #define CP_DST_SPACE m5_s2 /* T or D space (stack is also D) */
450 #define CP_DST_ENDPT m5_i2 /* process to copy to */
451 #define CP_DST_ADDR m5_l2 /* address where data go to */
452 #define CP_NR_BYTES m5_l3 /* number of bytes to copy */
454 /* Field names for SYS_GETINFO. */
455 #define I_REQUEST m7_i3 /* what info to get */
456 # define GET_KINFO 0 /* get kernel information structure */
457 # define GET_IMAGE 1 /* get system image table */
458 # define GET_PROCTAB 2 /* get kernel process table */
459 # define GET_RANDOMNESS 3 /* get randomness buffer */
460 # define GET_MONPARAMS 4 /* get monitor parameters */
461 # define GET_KENV 5 /* get kernel environment string */
462 # define GET_IRQHOOKS 6 /* get the IRQ table */
463 # define GET_KMESSAGES 7 /* get kernel messages */
464 # define GET_PRIVTAB 8 /* get kernel privileges table */
465 # define GET_KADDRESSES 9 /* get various kernel addresses */
466 # define GET_SCHEDINFO 10 /* get scheduling queues */
467 # define GET_PROC 11 /* get process slot if given process */
468 # define GET_MACHINE 12 /* get machine information */
469 # define GET_LOCKTIMING 13 /* get lock()/unlock() latency timing */
470 # define GET_BIOSBUFFER 14 /* get a buffer for BIOS calls */
471 # define GET_LOADINFO 15 /* get load average information */
472 # define GET_IRQACTIDS 16 /* get the IRQ masks */
473 # define GET_PRIV 17 /* get privilege structure */
474 # define GET_HZ 18 /* get HZ value */
475 # define GET_WHOAMI 19 /* get own name and endpoint */
476 # define GET_RANDOMNESS_BIN 20 /* get one randomness bin */
477 # define GET_IDLETSC 21 /* get cumulative idle time stamp counter */
478 # define GET_AOUTHEADER 22 /* get a.out headers from the boot image */
479 #define I_ENDPT m7_i4 /* calling process (may only be SELF) */
480 #define I_VAL_PTR m7_p1 /* virtual address at caller */
481 #define I_VAL_LEN m7_i1 /* max length of value */
482 #define I_VAL_PTR2 m7_p2 /* second virtual address */
483 #define I_VAL_LEN2_E m7_i2 /* second length, or proc nr */
485 /* GET_WHOAMI fields. */
486 #define GIWHO_EP m3_i1
487 #define GIWHO_NAME m3_ca1
489 /* Field names for SYS_TIMES. */
490 #define T_ENDPT m4_l1 /* process to request time info for */
491 #define T_USER_TIME m4_l1 /* user time consumed by process */
492 #define T_SYSTEM_TIME m4_l2 /* system time consumed by process */
493 #define T_BOOTTIME m4_l3 /* Boottime in seconds (also for SYS_STIME) */
494 #define T_BOOT_TICKS m4_l5 /* number of clock ticks since boot time */
496 /* Field names for SYS_TRACE, SYS_PRIVCTL, SYS_STATECTL. */
497 #define CTL_ENDPT m2_i1 /* process number of the caller */
498 #define CTL_REQUEST m2_i2 /* server control request */
499 #define CTL_ARG_PTR m2_p1 /* pointer to argument */
500 #define CTL_ADDRESS m2_l1 /* address at traced process' space */
501 #define CTL_DATA m2_l2 /* data field for tracing */
503 /* SYS_PRIVCTL with CTL_REQUEST == SYS_PRIV_QUERY_MEM */
504 #define CTL_PHYSSTART m2_l1 /* physical memory start in bytes*/
505 #define CTL_PHYSLEN m2_l2 /* length in bytes */
507 /* Subfunctions for SYS_PRIVCTL */
508 #define SYS_PRIV_ALLOW 1 /* Allow process to run */
509 #define SYS_PRIV_DISALLOW 2 /* Disallow process to run */
510 #define SYS_PRIV_SET_SYS 3 /* Set a system privilege structure */
511 #define SYS_PRIV_SET_USER 4 /* Set a user privilege structure */
512 #define SYS_PRIV_ADD_IO 5 /* Add I/O range (struct io_range) */
513 #define SYS_PRIV_ADD_MEM 6 /* Add memory range (struct mem_range)
515 #define SYS_PRIV_ADD_IRQ 7 /* Add IRQ */
516 #define SYS_PRIV_QUERY_MEM 8 /* Verify memory privilege. */
518 /* Field names for SYS_SETGRANT */
519 #define SG_ADDR m2_p1 /* address */
520 #define SG_SIZE m2_i2 /* no. of entries */
522 /* Field names for SYS_GETKSIG, _ENDKSIG, _KILL, _SIGSEND, _SIGRETURN. */
523 #define SIG_ENDPT m2_i1 /* process number for inform */
524 #define SIG_NUMBER m2_i2 /* signal number to send */
525 #define SIG_FLAGS m2_i3 /* signal flags field */
526 #define SIG_MAP m2_l1 /* used by kernel to pass signal bit map */
527 #define SIG_CTXT_PTR m2_p1 /* pointer to info to restore signal context */
529 /* Field names for SYS_FORK, _EXEC, _EXIT, _NEWMAP, GETMCONTEXT, SETMCONTEXT.*/
530 #define PR_ENDPT m1_i1 /* indicates a process */
531 #define PR_PRIORITY m1_i2 /* process priority */
532 #define PR_SLOT m1_i2 /* indicates a process slot */
533 #define PR_STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
534 #define PR_NAME_PTR m1_p2 /* tells where program name is for dmp */
535 #define PR_IP_PTR m1_p3 /* initial value for ip after exec */
536 #define PR_MEM_PTR m1_p1 /* tells where memory map is for sys_newmap
539 #define PR_FORK_FLAGS m1_i3 /* optional flags for fork operation */
540 #define PR_FORK_MSGADDR m1_p1 /* reply message address of forked child */
541 #define PR_CTX_PTR m1_p1 /* pointer to mcontext_t structure */
543 /* Flags for PR_FORK_FLAGS. */
544 #define PFF_VMINHIBIT 0x01 /* Don't schedule until release by VM. */
546 /* Field names for SYS_INT86 */
547 #define INT86_REG86 m1_p1 /* pointer to registers */
549 /* Field names for SYS_SAFECOPY* */
550 #define SCP_FROM_TO m2_i1 /* from/to whom? */
551 #define SCP_SEG m2_i2 /* my own segment */
552 #define SCP_GID m2_i3 /* grant id */
553 #define SCP_OFFSET m2_l1 /* offset within grant */
554 #define SCP_ADDRESS m2_p1 /* my own address */
555 #define SCP_BYTES m2_l2 /* bytes from offset */
557 /* Field names for SYS_VSAFECOPY* */
558 #define VSCP_VEC_ADDR m2_p1 /* start of vector */
559 #define VSCP_VEC_SIZE m2_l2 /* elements in vector */
561 /* Field names for SYS_SAFEMAPs */
562 #define SMAP_EP m2_i1
563 #define SMAP_GID m2_i2
564 #define SMAP_OFFSET m2_i3
565 #define SMAP_SEG m2_p1
566 #define SMAP_ADDRESS m2_l1
567 #define SMAP_BYTES m2_l2
568 #define SMAP_FLAG m2_s1
570 /* Field names for SYS_SPROF, _CPROF, _PROFBUF. */
571 #define PROF_ACTION m7_i1 /* start/stop/reset/get */
572 #define PROF_MEM_SIZE m7_i2 /* available memory for data */
573 #define PROF_FREQ m7_i3 /* sample frequency */
574 #define PROF_ENDPT m7_i4 /* endpoint of caller */
575 #define PROF_CTL_PTR m7_p1 /* location of info struct */
576 #define PROF_MEM_PTR m7_p2 /* location of profiling data */
578 /* Field names for SYS_READBIOS. */
579 #define RDB_SIZE m2_i1
580 #define RDB_ADDR m2_l1
581 #define RDB_BUF m2_p1
583 /* Field names for SYS_VMCTL. */
584 #define SVMCTL_WHO m1_i1
585 #define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */
586 #define SVMCTL_VALUE m1_i3
587 #define SVMCTL_MRG_TARGET m2_i1 /* MEMREQ_GET reply: target process */
588 #define SVMCTL_MRG_ADDR m2_i2 /* MEMREQ_GET reply: address */
589 #define SVMCTL_MRG_LENGTH m2_i3 /* MEMREQ_GET reply: length */
590 #define SVMCTL_MRG_FLAG m2_s1 /* MEMREQ_GET reply: flag */
591 #define SVMCTL_MRG_EP2 m2_l1 /* MEMREQ_GET reply: source process */
592 #define SVMCTL_MRG_ADDR2 m2_l2 /* MEMREQ_GET reply: source address */
593 #define SVMCTL_MRG_REQUESTOR m2_p1 /* MEMREQ_GET reply: requestor */
594 #define SVMCTL_MAP_VIR_ADDR m1_p1
595 #define SVMCTL_PTROOT m1_i3
596 #define SVMCTL_PTROOT_V m1_p1
598 /* Reply message for VMCTL_KERN_PHYSMAP */
599 #define SVMCTL_MAP_FLAGS m2_i1 /* VMMF_* */
600 #define SVMCTL_MAP_PHYS_ADDR m2_l1
601 #define SVMCTL_MAP_PHYS_LEN m2_l2
603 #define VMMF_UNCACHED (1L << 0)
605 /* Values for SVMCTL_PARAM. */
606 #define VMCTL_CLEAR_PAGEFAULT 12
607 #define VMCTL_I386_GETCR3 13
608 #define VMCTL_MEMREQ_GET 14
609 #define VMCTL_MEMREQ_REPLY 15
610 #define VMCTL_INCSP 16
611 #define VMCTL_NOPAGEZERO 18
612 #define VMCTL_I386_KERNELLIMIT 19
613 #define VMCTL_I386_FREEPDE 23
614 #define VMCTL_ENABLE_PAGING 24
615 #define VMCTL_I386_INVLPG 25
616 #define VMCTL_FLUSHTLB 26
617 #define VMCTL_KERN_PHYSMAP 27
618 #define VMCTL_KERN_MAP_REPLY 28
619 #define VMCTL_SETADDRSPACE 29
621 /* Codes and field names for SYS_SYSCTL. */
622 #define SYSCTL_CODE m1_i1 /* SYSCTL_CODE_* below */
623 #define SYSCTL_ARG1 m1_p1
624 #define SYSCTL_ARG2 m1_i2
625 #define SYSCTL_CODE_DIAG 1 /* Print diagnostics. */
626 #define SYSCTL_CODE_STACKTRACE 2 /* Print process stack. */
627 #define DIAG_BUFSIZE (80*25)
629 /* Field names for SYS_VTIMER. */
630 #define VT_WHICH m2_i1 /* which timer to set/retrieve */
631 # define VT_VIRTUAL 1 /* the ITIMER_VIRTUAL timer */
632 # define VT_PROF 2 /* the ITIMER_PROF timer */
633 #define VT_SET m2_i2 /* 1 for setting a timer, 0 retrieval only */
634 #define VT_VALUE m2_l1 /* new/previous value of the timer */
635 #define VT_ENDPT m2_l2 /* process to set/retrieve the timer for */
637 /* Field names for SYS_RUNCTL. */
638 #define RC_ENDPT m1_i1 /* which process to stop or resume */
639 #define RC_ACTION m1_i2 /* set or clear stop flag */
640 # define RC_STOP 0 /* stop the process */
641 # define RC_RESUME 1 /* clear the stop flag */
642 #define RC_FLAGS m1_i3 /* request flags */
643 # define RC_DELAY 1 /* delay stop if process is sending */
645 /* Field names for SYS_UPDATE. */
646 #define SYS_UPD_SRC_ENDPT m1_i1 /* source endpoint */
647 #define SYS_UPD_DST_ENDPT m1_i2 /* destination endpoint */
649 /* Subfunctions for SYS_STATECTL */
650 #define SYS_STATE_CLEAR_IPC_REFS 1 /* clear IPC references */
652 /*===========================================================================*
653 * Messages for the Reincarnation Server *
654 *===========================================================================*/
656 #define RS_RQ_BASE 0x700
658 #define RS_UP (RS_RQ_BASE + 0) /* start system service */
659 #define RS_DOWN (RS_RQ_BASE + 1) /* stop system service */
660 #define RS_REFRESH (RS_RQ_BASE + 2) /* refresh system service */
661 #define RS_RESTART (RS_RQ_BASE + 3) /* restart system service */
662 #define RS_SHUTDOWN (RS_RQ_BASE + 4) /* alert about shutdown */
663 #define RS_UPDATE (RS_RQ_BASE + 5) /* update system service */
665 #define RS_LOOKUP (RS_RQ_BASE + 8) /* lookup server name */
667 #define RS_INIT (RS_RQ_BASE + 20) /* service init message */
668 #define RS_LU_PREPARE (RS_RQ_BASE + 21) /* prepare to update message */
670 # define RS_CMD_ADDR m1_p1 /* command string */
671 # define RS_CMD_LEN m1_i1 /* length of command */
672 # define RS_PERIOD m1_i2 /* heartbeat period */
673 # define RS_DEV_MAJOR m1_i3 /* major device number */
675 # define RS_ENDPOINT m1_i1 /* endpoint number in reply */
677 # define RS_NAME m1_p1 /* name */
678 # define RS_NAME_LEN m1_i1 /* namelen */
680 # define RS_INIT_RESULT m7_i1 /* init result */
681 # define RS_INIT_TYPE m7_i2 /* init type */
682 # define RS_INIT_RPROCTAB_GID m7_i3 /* init rproc table gid */
683 # define RS_INIT_OLD_ENDPOINT m7_i4 /* init old endpoint */
685 # define RS_LU_RESULT m1_i1 /* live update result */
686 # define RS_LU_STATE m1_i2 /* state required to update */
687 # define RS_LU_PREPARE_MAXTIME m1_i3 /* the max time to prepare */
689 /*===========================================================================*
690 * Messages for the Data Store Server *
691 *===========================================================================*/
693 #define DS_RQ_BASE 0x800
695 #define DS_PUBLISH (DS_RQ_BASE + 0) /* publish data */
696 #define DS_RETRIEVE (DS_RQ_BASE + 1) /* retrieve data by name */
697 #define DS_SUBSCRIBE (DS_RQ_BASE + 2) /* subscribe to data updates */
698 #define DS_CHECK (DS_RQ_BASE + 3) /* retrieve updated data */
699 #define DS_DELETE (DS_RQ_BASE + 4) /* delete data */
700 #define DS_SNAPSHOT (DS_RQ_BASE + 5) /* take a snapshot */
701 #define DS_RETRIEVE_LABEL (DS_RQ_BASE + 6) /* retrieve label's name */
704 # define DS_KEY_GRANT m2_i1 /* key for the data */
705 # define DS_KEY_LEN m2_s1 /* length of key incl. '\0' */
706 # define DS_FLAGS m2_i2 /* flags provided by caller */
708 # define DS_VAL m2_l1 /* data (u32, char *, etc.) */
709 # define DS_VAL_LEN m2_l2 /* data length */
710 # define DS_NR_SNAPSHOT m2_i3 /* number of snapshot */
711 # define DS_OWNER m2_i3 /* owner */
713 /*===========================================================================*
714 * Miscellaneous messages used by TTY *
715 *===========================================================================*/
717 /* Miscellaneous request types and field names, e.g. used by IS server. */
718 #define FKEY_CONTROL 98 /* control a function key at the TTY */
719 # define FKEY_REQUEST m2_i1 /* request to perform at TTY */
720 # define FKEY_MAP 10 /* observe function key */
721 # define FKEY_UNMAP 11 /* stop observing function key */
722 # define FKEY_EVENTS 12 /* request open key presses */
723 # define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */
724 # define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */
725 #define DIAG_BASE 0xa00
726 #define DIAGNOSTICS_OLD (DIAG_BASE+1) /* output a string without FS in between */
727 #define DIAGNOSTICS_S_OLD (DIAG_BASE+2) /* grant-based version of DIAGNOSTICS */
728 # define DIAG_PRINT_BUF_G m1_p1
729 # define DIAG_BUF_COUNT m1_i1
730 #define GET_KMESS (DIAG_BASE+3) /* get kmess from TTY */
731 # define GETKM_PTR m1_p1
732 #define GET_KMESS_S (DIAG_BASE+4) /* get kmess from TTY */
733 # define GETKM_GRANT m1_i1
734 #define ASYN_DIAGNOSTICS_OLD (DIAG_BASE+5) /* grant-based, replyless DIAGNOSTICS */
736 #define DIAG_REPL_OLD (DIAG_BASE+0x80+0) /* reply to DIAGNOSTICS(_S) */
738 /*===========================================================================*
739 * Messages used between PM and VFS *
740 *===========================================================================*/
742 #define PM_RQ_BASE 0x900
743 #define PM_RS_BASE 0x980
745 /* Requests from PM to VFS */
746 #define PM_INIT (PM_RQ_BASE + 0) /* Process table exchange */
747 #define PM_SETUID (PM_RQ_BASE + 1) /* Set new user ID */
748 #define PM_SETGID (PM_RQ_BASE + 2) /* Set group ID */
749 #define PM_SETSID (PM_RQ_BASE + 3) /* Set session leader */
750 #define PM_EXIT (PM_RQ_BASE + 4) /* Process exits */
751 #define PM_DUMPCORE (PM_RQ_BASE + 5) /* Process is to dump core */
752 #define PM_EXEC (PM_RQ_BASE + 6) /* Forwarded exec call */
753 #define PM_FORK (PM_RQ_BASE + 7) /* Newly forked process */
754 #define PM_SRV_FORK (PM_RQ_BASE + 8) /* fork for system services */
755 #define PM_UNPAUSE (PM_RQ_BASE + 9) /* Interrupt process call */
756 #define PM_REBOOT (PM_RQ_BASE + 10) /* System reboot */
757 #define PM_SETGROUPS (PM_RQ_BASE + 11) /* Tell VFS about setgroups */
759 /* Replies from VFS to PM */
760 #define PM_SETUID_REPLY (PM_RS_BASE + 1)
761 #define PM_SETGID_REPLY (PM_RS_BASE + 2)
762 #define PM_SETSID_REPLY (PM_RS_BASE + 3)
763 #define PM_EXIT_REPLY (PM_RS_BASE + 4)
764 #define PM_CORE_REPLY (PM_RS_BASE + 5)
765 #define PM_EXEC_REPLY (PM_RS_BASE + 6)
766 #define PM_FORK_REPLY (PM_RS_BASE + 7)
767 #define PM_SRV_FORK_REPLY (PM_RS_BASE + 8)
768 #define PM_UNPAUSE_REPLY (PM_RS_BASE + 9)
769 #define PM_REBOOT_REPLY (PM_RS_BASE + 10)
770 #define PM_SETGROUPS_REPLY (PM_RS_BASE + 11)
772 /* Standard parameters for all requests and replies, except PM_REBOOT */
773 # define PM_PROC m1_i1 /* process endpoint */
775 /* Additional parameters for PM_INIT */
776 # define PM_SLOT m1_i2 /* process slot number */
777 # define PM_PID m1_i3 /* process pid */
779 /* Additional parameters for PM_SETUID and PM_SETGID */
780 # define PM_EID m1_i2 /* effective user/group id */
781 # define PM_RID m1_i3 /* real user/group id */
783 /* Additional parameter for PM_SETGROUPS */
784 # define PM_GROUP_NO m1_i2 /* number of groups */
785 # define PM_GROUP_ADDR m1_p1 /* struct holding group data */
787 /* Additional parameters for PM_EXEC */
788 # define PM_PATH m1_p1 /* executable */
789 # define PM_PATH_LEN m1_i2 /* length of path including
790 * terminating null character
792 # define PM_FRAME m1_p2 /* arguments and environment */
793 # define PM_FRAME_LEN m1_i3 /* size of frame */
795 /* Additional parameters for PM_EXEC_REPLY and PM_CORE_REPLY */
796 # define PM_STATUS m1_i2 /* OK or failure */
798 /* Additional parameters for PM_FORK and PM_SRV_FORK */
799 # define PM_PPROC m1_i2 /* parent process endpoint */
800 # define PM_CPID m1_i3 /* child pid */
802 /* Parameters for the EXEC_NEWMEM call */
803 #define EXC_NM_PROC m1_i1 /* process that needs new map */
804 #define EXC_NM_PTR m1_p1 /* parameters in struct exec_newmem */
806 * the status will be in m_type.
807 * the top of the stack will be in m1_i1.
808 * the following flags will be in m1_i2:
810 #define EXC_NM_RF_LOAD_TEXT 1 /* Load text segment (otherwise the
811 * text segment is already present)
813 #define EXC_NM_RF_ALLOW_SETUID 2 /* Setuid execution is allowed (tells
814 * FS to update its uid and gid
817 #define EXC_NM_RF_FULLVM 4
819 /* Parameters for the EXEC_RESTART call */
820 #define EXC_RS_PROC m1_i1 /* process that needs to be restarted */
821 #define EXC_RS_RESULT m1_i2 /* result of the exec */
823 /*===========================================================================*
824 * Messages used from VFS to file servers *
825 *===========================================================================*/
827 #define VFS_BASE 0xA00 /* Requests sent by VFS to filesystem
828 * implementations. See <minix/vfsif.h>
831 /*===========================================================================*
832 * Miscellaneous field names *
833 *===========================================================================*/
835 #define COMMON_RQ_BASE 0xE00
839 #define PMBRK_ADDR m1_p1
842 #define PMTRACE_ADDR m2_l1
844 #define PM_ENDPT m1_i1
845 #define PM_PENDPT m1_i2
847 /* Field names for GETSYSINFO_UP (PM). */
848 #define SIU_WHAT m2_i1
849 #define SIU_LEN m2_i2
850 #define SIU_WHERE m2_p1
852 /* Field names for SELECT (FS). */
853 #define SEL_NFDS m8_i1
854 #define SEL_READFDS m8_p1
855 #define SEL_WRITEFDS m8_p2
856 #define SEL_ERRORFDS m8_p3
857 #define SEL_TIMEOUT m8_p4
859 /* Field names for system signals (sent by a signal manager). */
860 #define SIGS_SIGNAL_RECEIVED (COMMON_RQ_BASE+0)
861 # define SIGS_SIG_NUM m2_i1
863 /*===========================================================================*
864 * Messages for VM server *
865 *===========================================================================*/
866 #define VM_RQ_BASE 0xC00
869 #define VM_EXIT (VM_RQ_BASE+0)
870 # define VME_ENDPOINT m1_i1
871 #define VM_FORK (VM_RQ_BASE+1)
872 # define VMF_ENDPOINT m1_i1
873 # define VMF_SLOTNO m1_i2
874 # define VMF_CHILD_ENDPOINT m1_i3 /* result */
875 #define VM_BRK (VM_RQ_BASE+2)
876 # define VMB_ENDPOINT m1_i1
877 # define VMB_ADDR m1_p1
878 # define VMB_RETADDR m1_p2 /* result */
879 #define VM_EXEC_NEWMEM (VM_RQ_BASE+3)
880 # define VMEN_ENDPOINT m1_i1
881 # define VMEN_ARGSPTR m1_p1
882 # define VMEN_ARGSSIZE m1_i2
883 # define VMEN_FLAGS m1_i3 /* result */
884 # define VMEN_STACK_TOP m1_p2 /* result */
885 #define VM_PUSH_SIG (VM_RQ_BASE+4)
886 # define VMPS_ENDPOINT m1_i1
887 # define VMPS_OLD_SP m1_p1 /* result */
888 #define VM_WILLEXIT (VM_RQ_BASE+5)
889 # define VMWE_ENDPOINT m1_i1
892 #define VM_MMAP (VM_RQ_BASE+10)
893 # define VMM_ADDR m5_l1
894 # define VMM_LEN m5_l2
895 # define VMM_PROT m5_s1
896 # define VMM_FLAGS m5_s2
897 # define VMM_FD m5_i1
898 # define VMM_OFFSET m5_i2
899 # define VMM_RETADDR m5_l1 /* result */
900 #define VM_UMAP (VM_RQ_BASE+11)
901 # define VMU_SEG m1_i1
902 # define VMU_OFFSET m1_p1
903 # define VMU_LENGTH m1_p2
904 # define VMU_RETADDR m1_p3
906 /* to VM: inform VM about a region of memory that is used for
909 #define VM_ADDDMA (VM_RQ_BASE+12)
910 # define VMAD_REQ m2_i2
911 # define VMAD_EP m2_i1
912 # define VMAD_START m2_l1
913 # define VMAD_SIZE m2_l2
915 /* to VM: inform VM that a region of memory that is no longer
916 * used for bus-master DMA
918 #define VM_DELDMA (VM_RQ_BASE+13)
919 # define VMDD_REQ m2_i2
920 # define VMDD_EP m2_i1
921 # define VMDD_START m2_l1
922 # define VMDD_SIZE m2_l2
924 /* to VM: ask VM for a region of memory that should not
925 * be used for bus-master DMA any longer
927 #define VM_GETDMA (VM_RQ_BASE+14)
928 # define VMGD_REQ m2_i2
929 # define VMGD_PROCP m2_i1
930 # define VMGD_BASEP m2_l1
931 # define VMGD_SIZEP m2_l2
933 #define VM_MAP_PHYS (VM_RQ_BASE+15)
934 # define VMMP_EP m1_i1
935 # define VMMP_PHADDR m1_p2
936 # define VMMP_LEN m1_i2
937 # define VMMP_VADDR_REPLY m1_p3
939 #define VM_UNMAP_PHYS (VM_RQ_BASE+16)
940 # define VMUP_EP m1_i1
941 # define VMUP_VADDR m1_p1
943 #define VM_MUNMAP (VM_RQ_BASE+17)
944 # define VMUM_ADDR m1_p1
945 # define VMUM_LEN m1_i1
947 #define VM_MUNMAP_TEXT (VM_RQ_BASE+19)
949 /* To VM: forget all my yielded blocks. */
950 #define VM_FORGETBLOCKS (VM_RQ_BASE+22)
952 /* To VM: forget this block. */
953 #define VM_FORGETBLOCK (VM_RQ_BASE+23)
954 #define VMFB_IDHI m1_i1
955 #define VMFB_IDLO m1_i2
957 /* To VM: combined yield+get call. */
958 #define VM_YIELDBLOCKGETBLOCK (VM_RQ_BASE+25)
959 #define VMYBGB_VADDR m2_p1
960 #define VMYBGB_GETIDHI m2_i1
961 #define VMYBGB_GETIDLO m2_i2
962 #define VMYBGB_LEN m2_i3
963 #define VMYBGB_YIELDIDHI m2_l1
964 #define VMYBGB_YIELDIDLO m2_l2
966 /* Calls from VFS. */
967 # define VMV_ENDPOINT m1_i1 /* for all VM_VFS_REPLY_* */
968 #define VM_VFS_REPLY_OPEN (VM_RQ_BASE+30)
969 # define VMVRO_FD m1_i2
970 #define VM_VFS_REPLY_MMAP (VM_RQ_BASE+31)
971 #define VM_VFS_REPLY_CLOSE (VM_RQ_BASE+32)
973 #define VM_REMAP (VM_RQ_BASE+33)
974 # define VMRE_D m1_i1
975 # define VMRE_S m1_i2
976 # define VMRE_DA m1_p1
977 # define VMRE_SA m1_p2
978 # define VMRE_RETA m1_p3
979 # define VMRE_SIZE m1_i3
981 #define VM_SHM_UNMAP (VM_RQ_BASE+34)
982 # define VMUN_ENDPT m2_i1
983 # define VMUN_ADDR m2_l1
985 #define VM_GETPHYS (VM_RQ_BASE+35)
986 # define VMPHYS_ENDPT m2_i1
987 # define VMPHYS_ADDR m2_l1
988 # define VMPHYS_RETA m2_l2
990 #define VM_GETREF (VM_RQ_BASE+36)
991 # define VMREFCNT_ENDPT m2_i1
992 # define VMREFCNT_ADDR m2_l1
993 # define VMREFCNT_RETC m2_i2
995 #define VM_RS_SET_PRIV (VM_RQ_BASE+37)
996 # define VM_RS_NR m2_i1
997 # define VM_RS_BUF m2_l1
999 #define VM_QUERY_EXIT (VM_RQ_BASE+38)
1000 # define VM_QUERY_RET_PT m2_i1
1001 # define VM_QUERY_IS_MORE m2_i2
1003 #define VM_NOTIFY_SIG (VM_RQ_BASE+39)
1004 # define VM_NOTIFY_SIG_ENDPOINT m1_i1
1005 # define VM_NOTIFY_SIG_IPC m1_i2
1007 #define VM_INFO (VM_RQ_BASE+40)
1008 # define VMI_WHAT m2_i1
1009 # define VMI_EP m2_i2
1010 # define VMI_COUNT m2_i3
1011 # define VMI_PTR m2_p1
1012 # define VMI_NEXT m2_l1
1014 /* VMI_WHAT values. */
1015 #define VMIW_STATS 1
1016 #define VMIW_USAGE 2
1017 #define VMIW_REGION 3
1019 #define VM_RS_UPDATE (VM_RQ_BASE+41)
1020 # define VM_RS_SRC_ENDPT m1_i1
1021 # define VM_RS_DST_ENDPT m1_i2
1024 #define NR_VM_CALLS 42
1025 #define VM_CALL_MASK_SIZE BITMAP_CHUNKS(NR_VM_CALLS)
1027 /* not handled as a normal VM call, thus at the end of the reserved rage */
1028 #define VM_PAGEFAULT (VM_RQ_BASE+0xff)
1029 # define VPF_ADDR m1_i1
1030 # define VPF_FLAGS m1_i2
1032 /* Basic vm calls allowed to every process. */
1033 #define VM_BASIC_CALLS \
1034 VM_MMAP, VM_MUNMAP, VM_MUNMAP_TEXT, VM_MAP_PHYS, VM_UNMAP_PHYS, \
1035 VM_FORGETBLOCKS, VM_FORGETBLOCK, VM_YIELDBLOCKGETBLOCK
1037 /*===========================================================================*
1038 * Messages for IPC server *
1039 *===========================================================================*/
1040 #define IPC_BASE 0xD00
1043 #define IPC_SHMGET (IPC_BASE+1)
1044 # define SHMGET_KEY m2_l1
1045 # define SHMGET_SIZE m2_l2
1046 # define SHMGET_FLAG m2_i1
1047 # define SHMGET_RETID m2_i2
1048 #define IPC_SHMAT (IPC_BASE+2)
1049 # define SHMAT_ID m2_i1
1050 # define SHMAT_ADDR m2_l1
1051 # define SHMAT_FLAG m2_i2
1052 # define SHMAT_RETADDR m2_l2
1053 #define IPC_SHMDT (IPC_BASE+3)
1054 # define SHMDT_ADDR m2_l1
1055 #define IPC_SHMCTL (IPC_BASE+4)
1056 # define SHMCTL_ID m2_i1
1057 # define SHMCTL_CMD m2_i2
1058 # define SHMCTL_BUF m2_l1
1059 # define SHMCTL_RET m2_i3
1062 #define IPC_SEMGET (IPC_BASE+5)
1063 # define SEMGET_KEY m2_l1
1064 # define SEMGET_NR m2_i1
1065 # define SEMGET_FLAG m2_i2
1066 # define SEMGET_RETID m2_i3
1067 #define IPC_SEMCTL (IPC_BASE+6)
1068 # define SEMCTL_ID m2_i1
1069 # define SEMCTL_NUM m2_i2
1070 # define SEMCTL_CMD m2_i3
1071 # define SEMCTL_OPT m2_l1
1072 #define IPC_SEMOP (IPC_BASE+7)
1073 # define SEMOP_ID m2_i1
1074 # define SEMOP_OPS m2_l1
1075 # define SEMOP_SIZE m2_i2
1077 /*===========================================================================*
1078 * Messages for Scheduling *
1079 *===========================================================================*/
1080 #define SCHEDULING_BASE 0xF00
1082 #define SCHEDULING_NO_QUANTUM (SCHEDULING_BASE+1)
1083 # define SCHEDULING_ENDPOINT m9_l1
1084 # define SCHEDULING_QUANTUM m9_l2
1085 # define SCHEDULING_PRIORITY m9_s1
1087 /* SCHEDULING_START uses _ENDPOINT, _PRIORITY and _QUANTUM from
1088 * SCHEDULING_NO_QUANTUM */
1089 #define SCHEDULING_START (SCHEDULING_BASE+2)
1090 # define SCHEDULING_SCHEDULER m9_l1 /* Overrides _ENDPOINT on return*/
1091 # define SCHEDULING_PARENT m9_l3
1092 # define SCHEDULING_NICE m9_l4
1094 #define SCHEDULING_STOP (SCHEDULING_BASE+3)
1096 #define SCHEDULING_SET_NICE (SCHEDULING_BASE+4)