1 | #ifndef _MINIX_COM_H
|
---|
2 | #define _MINIX_COM_H
|
---|
3 |
|
---|
4 | /*===========================================================================*
|
---|
5 | * Magic process numbers *
|
---|
6 | *===========================================================================*/
|
---|
7 |
|
---|
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 */
|
---|
14 |
|
---|
15 | /*===========================================================================*
|
---|
16 | * Process numbers of processes in the system image *
|
---|
17 | *===========================================================================*/
|
---|
18 |
|
---|
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.
|
---|
24 | */
|
---|
25 |
|
---|
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 */
|
---|
32 |
|
---|
33 | /* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */
|
---|
34 | #define NR_TASKS 4
|
---|
35 |
|
---|
36 | /* User-space processes, that is, device drivers, servers, and INIT. */
|
---|
37 | /* ATTENZIONE: l'ordine deve corrispondere a quello della boot image *
|
---|
38 | #define PM_PROC_NR 0 /* process manager */
|
---|
39 | #define FS_PROC_NR 1 /* file system */
|
---|
40 | #define RS_PROC_NR 2 /* reincarnation server */
|
---|
41 | #define TTY_PROC_NR 3 /* terminal (TTY) driver */
|
---|
42 | #define DS_PROC_NR 4 /* data store server */
|
---|
43 | #define SS_PROC_NR 5 /* semaphore server */
|
---|
44 | #define MEM_PROC_NR 6 /* memory driver (RAM disk, null, etc.) */
|
---|
45 | #define LOG_PROC_NR 7 /* log device driver */
|
---|
46 | #define INIT_PROC_NR 8 /* init -- goes multiuser */
|
---|
47 |
|
---|
48 | /* Number of processes contained in the system image. */
|
---|
49 | #define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1)
|
---|
50 |
|
---|
51 | /*===========================================================================*
|
---|
52 | * Kernel notification types *
|
---|
53 | *===========================================================================*/
|
---|
54 |
|
---|
55 | /* Kernel notification types. In principle, these can be sent to any process,
|
---|
56 | * so make sure that these types do not interfere with other message types.
|
---|
57 | * Notifications are prioritized because of the way they are unhold() and
|
---|
58 | * blocking notifications are delivered. The lowest numbers go first. The
|
---|
59 | * offset are used for the per-process notification bit maps.
|
---|
60 | */
|
---|
61 | #define NOTIFY_MESSAGE 0x1000
|
---|
62 | #define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS))
|
---|
63 | # define PROC_EVENT NOTIFY_FROM(PM_PROC_NR) /* process status change */
|
---|
64 | # define SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */
|
---|
65 | # define SYS_SIG NOTIFY_FROM(SYSTEM) /* system signal */
|
---|
66 | # define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */
|
---|
67 | # define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */
|
---|
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 |
|
---|
71 | /* Shorthands for message parameters passed with notifications. */
|
---|
72 | #define NOTIFY_SOURCE m_source
|
---|
73 | #define NOTIFY_TYPE m_type
|
---|
74 | #define NOTIFY_ARG m2_l1
|
---|
75 | #define NOTIFY_TIMESTAMP m2_l2
|
---|
76 | #define NOTIFY_FLAGS m2_i1
|
---|
77 |
|
---|
78 | /*===========================================================================*
|
---|
79 | * Messages for BUS controller drivers *
|
---|
80 | *===========================================================================*/
|
---|
81 | #define BUSC_RQ_BASE 0x300 /* base for request types */
|
---|
82 | #define BUSC_RS_BASE 0x380 /* base for response types */
|
---|
83 |
|
---|
84 | #define BUSC_PCI_INIT (BUSC_RQ_BASE + 0) /* First message to
|
---|
85 | * PCI driver
|
---|
86 | */
|
---|
87 | #define BUSC_PCI_FIRST_DEV (BUSC_RQ_BASE + 1) /* Get index (and
|
---|
88 | * vid/did) of the
|
---|
89 | * first PCI device
|
---|
90 | */
|
---|
91 | #define BUSC_PCI_NEXT_DEV (BUSC_RQ_BASE + 2) /* Get index (and
|
---|
92 | * vid/did) of the
|
---|
93 | * next PCI device
|
---|
94 | */
|
---|
95 | #define BUSC_PCI_FIND_DEV (BUSC_RQ_BASE + 3) /* Get index of a
|
---|
96 | * PCI device based on
|
---|
97 | * bus/dev/function
|
---|
98 | */
|
---|
99 | #define BUSC_PCI_IDS (BUSC_RQ_BASE + 4) /* Get vid/did from an
|
---|
100 | * index
|
---|
101 | */
|
---|
102 | #define BUSC_PCI_DEV_NAME (BUSC_RQ_BASE + 5) /* Get the name of a
|
---|
103 | * PCI device
|
---|
104 | */
|
---|
105 | #define BUSC_PCI_SLOT_NAME (BUSC_RQ_BASE + 6) /* Get the name of a
|
---|
106 | * PCI slot
|
---|
107 | */
|
---|
108 | #define BUSC_PCI_RESERVE (BUSC_RQ_BASE + 7) /* Reserve a PCI dev */
|
---|
109 | #define BUSC_PCI_ATTR_R8 (BUSC_RQ_BASE + 8) /* Read 8-bit
|
---|
110 | * attribute value
|
---|
111 | */
|
---|
112 | #define BUSC_PCI_ATTR_R16 (BUSC_RQ_BASE + 9) /* Read 16-bit
|
---|
113 | * attribute value
|
---|
114 | */
|
---|
115 | #define BUSC_PCI_ATTR_R32 (BUSC_RQ_BASE + 10) /* Read 32-bit
|
---|
116 | * attribute value
|
---|
117 | */
|
---|
118 | #define BUSC_PCI_ATTR_W8 (BUSC_RQ_BASE + 11) /* Write 8-bit
|
---|
119 | * attribute value
|
---|
120 | */
|
---|
121 | #define BUSC_PCI_ATTR_W16 (BUSC_RQ_BASE + 12) /* Write 16-bit
|
---|
122 | * attribute value
|
---|
123 | */
|
---|
124 | #define BUSC_PCI_ATTR_W32 (BUSC_RQ_BASE + 13) /* Write 32-bit
|
---|
125 | * attribute value
|
---|
126 | */
|
---|
127 | #define BUSC_PCI_RESCAN (BUSC_RQ_BASE + 14) /* Rescan bus */
|
---|
128 |
|
---|
129 | /*===========================================================================*
|
---|
130 | * Messages for BLOCK and CHARACTER device drivers *
|
---|
131 | *===========================================================================*/
|
---|
132 |
|
---|
133 | /* Message types for device drivers. */
|
---|
134 | #define DEV_RQ_BASE 0x400 /* base for device request types */
|
---|
135 | #define DEV_RS_BASE 0x500 /* base for device response types */
|
---|
136 |
|
---|
137 | #define CANCEL (DEV_RQ_BASE + 0) /* force a task to cancel */
|
---|
138 | #define DEV_READ (DEV_RQ_BASE + 3) /* read from minor device */
|
---|
139 | #define DEV_WRITE (DEV_RQ_BASE + 4) /* write to minor device */
|
---|
140 | #define DEV_IOCTL (DEV_RQ_BASE + 5) /* I/O control code */
|
---|
141 | #define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */
|
---|
142 | #define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */
|
---|
143 | #define DEV_SCATTER (DEV_RQ_BASE + 8) /* write from a vector */
|
---|
144 | #define DEV_GATHER (DEV_RQ_BASE + 9) /* read into a vector */
|
---|
145 | #define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */
|
---|
146 | #define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */
|
---|
147 | #define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */
|
---|
148 | #define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */
|
---|
149 |
|
---|
150 | #define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */
|
---|
151 | #define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */
|
---|
152 | #define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */
|
---|
153 | #define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */
|
---|
154 | #define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply */
|
---|
155 |
|
---|
156 | /* Field names for messages to block and character device drivers. */
|
---|
157 | #define DEVICE m2_i1 /* major-minor device */
|
---|
158 | #define IO_ENDPT m2_i2 /* which (proc/endpoint) wants I/O? */
|
---|
159 | #define COUNT m2_i3 /* how many bytes to transfer */
|
---|
160 | #define REQUEST m2_i3 /* ioctl request code */
|
---|
161 | #define POSITION m2_l1 /* file offset */
|
---|
162 | #define ADDRESS m2_p1 /* core buffer address */
|
---|
163 |
|
---|
164 | /* Field names for DEV_SELECT messages to device drivers. */
|
---|
165 | #define DEV_MINOR m2_i1 /* minor device */
|
---|
166 | #define DEV_SEL_OPS m2_i2 /* which select operations are requested */
|
---|
167 | #define DEV_SEL_WATCH m2_i3 /* request notify if no operations are ready */
|
---|
168 |
|
---|
169 | /* Field names used in reply messages from tasks. */
|
---|
170 | #define REP_ENDPT m2_i1 /* # of proc on whose behalf I/O was done */
|
---|
171 | #define REP_STATUS m2_i2 /* bytes transferred or error number */
|
---|
172 | # define SUSPEND -998 /* status to suspend caller, reply later */
|
---|
173 |
|
---|
174 | /* Field names for messages to TTY driver. */
|
---|
175 | #define TTY_LINE DEVICE /* message parameter: terminal line */
|
---|
176 | #define TTY_REQUEST COUNT /* message parameter: ioctl request code */
|
---|
177 | #define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */
|
---|
178 | #define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
|
---|
179 | #define TTY_PGRP m2_i3 /* message parameter: process group */
|
---|
180 |
|
---|
181 | /* Field names for the QIC 02 status reply from tape driver */
|
---|
182 | #define TAPE_STAT0 m2_l1
|
---|
183 | #define TAPE_STAT1 m2_l2
|
---|
184 |
|
---|
185 | /*===========================================================================*
|
---|
186 | * Messages for networking layer *
|
---|
187 | *===========================================================================*/
|
---|
188 |
|
---|
189 | /* Message types for network layer requests. This layer acts like a driver. */
|
---|
190 | #define NW_OPEN DEV_OPEN
|
---|
191 | #define NW_CLOSE DEV_CLOSE
|
---|
192 | #define NW_READ DEV_READ
|
---|
193 | #define NW_WRITE DEV_WRITE
|
---|
194 | #define NW_IOCTL DEV_IOCTL
|
---|
195 | #define NW_CANCEL CANCEL
|
---|
196 |
|
---|
197 | /* Base type for data link layer requests and responses. */
|
---|
198 | #define DL_RQ_BASE 0x800
|
---|
199 | #define DL_RS_BASE 0x900
|
---|
200 |
|
---|
201 | /* Message types for data link layer requests. */
|
---|
202 | #define DL_WRITE (DL_RQ_BASE + 3)
|
---|
203 | #define DL_WRITEV (DL_RQ_BASE + 4)
|
---|
204 | #define DL_READ (DL_RQ_BASE + 5)
|
---|
205 | #define DL_READV (DL_RQ_BASE + 6)
|
---|
206 | #define DL_INIT (DL_RQ_BASE + 7)
|
---|
207 | #define DL_STOP (DL_RQ_BASE + 8)
|
---|
208 | #define DL_GETSTAT (DL_RQ_BASE + 9)
|
---|
209 | #define DL_GETNAME (DL_RQ_BASE +10)
|
---|
210 |
|
---|
211 | /* Message type for data link layer replies. */
|
---|
212 | #define DL_INIT_REPLY (DL_RS_BASE + 20)
|
---|
213 | #define DL_TASK_REPLY (DL_RS_BASE + 21)
|
---|
214 | #define DL_NAME_REPLY (DL_RS_BASE + 22)
|
---|
215 |
|
---|
216 | /* Field names for data link layer messages. */
|
---|
217 | #define DL_PORT m2_i1
|
---|
218 | #define DL_PROC m2_i2 /* endpoint */
|
---|
219 | #define DL_COUNT m2_i3
|
---|
220 | #define DL_MODE m2_l1
|
---|
221 | #define DL_CLCK m2_l2
|
---|
222 | #define DL_ADDR m2_p1
|
---|
223 | #define DL_STAT m2_l1
|
---|
224 | #define DL_NAME m3_ca1
|
---|
225 |
|
---|
226 | /* Bits in 'DL_STAT' field of DL replies. */
|
---|
227 | # define DL_PACK_SEND 0x01
|
---|
228 | # define DL_PACK_RECV 0x02
|
---|
229 | # define DL_READ_IP 0x04
|
---|
230 |
|
---|
231 | /* Bits in 'DL_MODE' field of DL requests. */
|
---|
232 | # define DL_NOMODE 0x0
|
---|
233 | # define DL_PROMISC_REQ 0x2
|
---|
234 | # define DL_MULTI_REQ 0x4
|
---|
235 | # define DL_BROAD_REQ 0x8
|
---|
236 |
|
---|
237 | /*===========================================================================*
|
---|
238 | * SYSTASK request types and field names *
|
---|
239 | *===========================================================================*/
|
---|
240 |
|
---|
241 | /* System library calls are dispatched via a call vector, so be careful when
|
---|
242 | * modifying the system call numbers. The numbers here determine which call
|
---|
243 | * is made from the call vector.
|
---|
244 | */
|
---|
245 | #define KERNEL_CALL 0x600 /* base for kernel calls to SYSTEM */
|
---|
246 |
|
---|
247 | # define SYS_FORK (KERNEL_CALL + 0) /* sys_fork() */
|
---|
248 | # define SYS_EXEC (KERNEL_CALL + 1) /* sys_exec() */
|
---|
249 | # define SYS_EXIT (KERNEL_CALL + 2) /* sys_exit() */
|
---|
250 | # define SYS_NICE (KERNEL_CALL + 3) /* sys_nice() */
|
---|
251 | # define SYS_PRIVCTL (KERNEL_CALL + 4) /* sys_privctl() */
|
---|
252 | # define SYS_TRACE (KERNEL_CALL + 5) /* sys_trace() */
|
---|
253 | # define SYS_KILL (KERNEL_CALL + 6) /* sys_kill() */
|
---|
254 |
|
---|
255 | # define SYS_GETKSIG (KERNEL_CALL + 7) /* sys_getsig() */
|
---|
256 | # define SYS_ENDKSIG (KERNEL_CALL + 8) /* sys_endsig() */
|
---|
257 | # define SYS_SIGSEND (KERNEL_CALL + 9) /* sys_sigsend() */
|
---|
258 | # define SYS_SIGRETURN (KERNEL_CALL + 10) /* sys_sigreturn() */
|
---|
259 |
|
---|
260 | # define SYS_NEWMAP (KERNEL_CALL + 11) /* sys_newmap() */
|
---|
261 | # define SYS_SEGCTL (KERNEL_CALL + 12) /* sys_segctl() */
|
---|
262 | # define SYS_MEMSET (KERNEL_CALL + 13) /* sys_memset() */
|
---|
263 |
|
---|
264 | # define SYS_UMAP (KERNEL_CALL + 14) /* sys_umap() */
|
---|
265 | # define SYS_VIRCOPY (KERNEL_CALL + 15) /* sys_vircopy() */
|
---|
266 | # define SYS_PHYSCOPY (KERNEL_CALL + 16) /* sys_physcopy() */
|
---|
267 | # define SYS_VIRVCOPY (KERNEL_CALL + 17) /* sys_virvcopy() */
|
---|
268 | # define SYS_PHYSVCOPY (KERNEL_CALL + 18) /* sys_physvcopy() */
|
---|
269 |
|
---|
270 | # define SYS_IRQCTL (KERNEL_CALL + 19) /* sys_irqctl() */
|
---|
271 | # define SYS_INT86 (KERNEL_CALL + 20) /* sys_int86() */
|
---|
272 | # define SYS_DEVIO (KERNEL_CALL + 21) /* sys_devio() */
|
---|
273 | # define SYS_SDEVIO (KERNEL_CALL + 22) /* sys_sdevio() */
|
---|
274 | # define SYS_VDEVIO (KERNEL_CALL + 23) /* sys_vdevio() */
|
---|
275 |
|
---|
276 | # define SYS_SETALARM (KERNEL_CALL + 24) /* sys_setalarm() */
|
---|
277 | # define SYS_TIMES (KERNEL_CALL + 25) /* sys_times() */
|
---|
278 | # define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */
|
---|
279 | # define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */
|
---|
280 | # define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
|
---|
281 | # define SYS_VM_SETBUF (KERNEL_CALL + 29) /* sys_vm_setbuf() */
|
---|
282 | # define SYS_VM_MAP (KERNEL_CALL + 30) /* sys_vm_map() */
|
---|
283 |
|
---|
284 | #define NR_SYS_CALLS 31 /* number of system calls */
|
---|
285 |
|
---|
286 | /* Subfunctions for SYS_PRIVCTL */
|
---|
287 | #define SYS_PRIV_INIT 1 /* Initialize a privilege structure */
|
---|
288 | #define SYS_PRIV_ADD_IO 2 /* Add I/O range (struct io_range) */
|
---|
289 | #define SYS_PRIV_ADD_MEM 3 /* Add memory range (struct mem_range)
|
---|
290 | */
|
---|
291 | #define SYS_PRIV_ADD_IRQ 4 /* Add IRQ */
|
---|
292 |
|
---|
293 | /* Field names for SYS_MEMSET, SYS_SEGCTL. */
|
---|
294 | #define MEM_PTR m2_p1 /* base */
|
---|
295 | #define MEM_COUNT m2_l1 /* count */
|
---|
296 | #define MEM_PATTERN m2_l2 /* pattern to write */
|
---|
297 | #define MEM_CHUNK_BASE m4_l1 /* physical base address */
|
---|
298 | #define MEM_CHUNK_SIZE m4_l2 /* size of mem chunk */
|
---|
299 | #define MEM_TOT_SIZE m4_l3 /* total memory size */
|
---|
300 | #define MEM_CHUNK_TAG m4_l4 /* tag to identify chunk of mem */
|
---|
301 |
|
---|
302 | /* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
|
---|
303 | #define DIO_REQUEST m2_i3 /* device in or output */
|
---|
304 | # define DIO_INPUT 0 /* input */
|
---|
305 | # define DIO_OUTPUT 1 /* output */
|
---|
306 | #define DIO_TYPE m2_i1 /* flag indicating byte, word, or long */
|
---|
307 | # define DIO_BYTE 'b' /* byte type values */
|
---|
308 | # define DIO_WORD 'w' /* word type values */
|
---|
309 | # define DIO_LONG 'l' /* long type values */
|
---|
310 | #define DIO_PORT m2_l1 /* single port address */
|
---|
311 | #define DIO_VALUE m2_l2 /* single I/O value */
|
---|
312 | #define DIO_VEC_ADDR m2_p1 /* address of buffer or (p,v)-pairs */
|
---|
313 | #define DIO_VEC_SIZE m2_l2 /* number of elements in vector */
|
---|
314 | #define DIO_VEC_ENDPT m2_i2 /* number of process where vector is */
|
---|
315 |
|
---|
316 | /* Field names for SYS_SIGNARLM, SYS_FLAGARLM, SYS_SYNCALRM. */
|
---|
317 | #define ALRM_EXP_TIME m2_l1 /* expire time for the alarm call */
|
---|
318 | #define ALRM_ABS_TIME m2_i2 /* set to 1 to use absolute alarm time */
|
---|
319 | #define ALRM_TIME_LEFT m2_l1 /* how many ticks were remaining */
|
---|
320 | #define ALRM_ENDPT m2_i1 /* which process wants the alarm? */
|
---|
321 | #define ALRM_FLAG_PTR m2_p1 /* virtual address of timeout flag */
|
---|
322 |
|
---|
323 | /* Field names for SYS_IRQCTL. */
|
---|
324 | #define IRQ_REQUEST m5_c1 /* what to do? */
|
---|
325 | # define IRQ_SETPOLICY 1 /* manage a slot of the IRQ table */
|
---|
326 | # define IRQ_RMPOLICY 2 /* remove a slot of the IRQ table */
|
---|
327 | # define IRQ_ENABLE 3 /* enable interrupts */
|
---|
328 | # define IRQ_DISABLE 4 /* disable interrupts */
|
---|
329 | #define IRQ_VECTOR m5_c2 /* irq vector */
|
---|
330 | #define IRQ_POLICY m5_i1 /* options for IRQCTL request */
|
---|
331 | # define IRQ_REENABLE 0x001 /* reenable IRQ line after interrupt */
|
---|
332 | # define IRQ_BYTE 0x100 /* byte values */
|
---|
333 | # define IRQ_WORD 0x200 /* word values */
|
---|
334 | # define IRQ_LONG 0x400 /* long values */
|
---|
335 | #define IRQ_ENDPT m5_i2 /* endpoint number, SELF, NONE */
|
---|
336 | #define IRQ_HOOK_ID m5_l3 /* id of irq hook at kernel */
|
---|
337 |
|
---|
338 | /* Field names for SYS_SEGCTL. */
|
---|
339 | #define SEG_SELECT m4_l1 /* segment selector returned */
|
---|
340 | #define SEG_OFFSET m4_l2 /* offset in segment returned */
|
---|
341 | #define SEG_PHYS m4_l3 /* physical address of segment */
|
---|
342 | #define SEG_SIZE m4_l4 /* segment size */
|
---|
343 | #define SEG_INDEX m4_l5 /* segment index in remote map */
|
---|
344 |
|
---|
345 | /* Field names for SYS_VIDCOPY. */
|
---|
346 | #define VID_REQUEST m4_l1 /* what to do? */
|
---|
347 | # define VID_VID_COPY 1 /* request vid_vid_copy() */
|
---|
348 | # define MEM_VID_COPY 2 /* request mem_vid_copy() */
|
---|
349 | #define VID_SRC_ADDR m4_l2 /* virtual address in memory */
|
---|
350 | #define VID_SRC_OFFSET m4_l3 /* offset in video memory */
|
---|
351 | #define VID_DST_OFFSET m4_l4 /* offset in video memory */
|
---|
352 | #define VID_CP_COUNT m4_l5 /* number of words to be copied */
|
---|
353 |
|
---|
354 | /* Field names for SYS_ABORT. */
|
---|
355 | #define ABRT_HOW m1_i1 /* RBT_REBOOT, RBT_HALT, etc. */
|
---|
356 | #define ABRT_MON_ENDPT m1_i2 /* process where monitor params are */
|
---|
357 | #define ABRT_MON_LEN m1_i3 /* length of monitor params */
|
---|
358 | #define ABRT_MON_ADDR m1_p1 /* virtual address of monitor params */
|
---|
359 |
|
---|
360 | /* Field names for _UMAP, _VIRCOPY, _PHYSCOPY. */
|
---|
361 | #define CP_SRC_SPACE m5_c1 /* T or D space (stack is also D) */
|
---|
362 | #define CP_SRC_ENDPT m5_i1 /* process to copy from */
|
---|
363 | #define CP_SRC_ADDR m5_l1 /* address where data come from */
|
---|
364 | #define CP_DST_SPACE m5_c2 /* T or D space (stack is also D) */
|
---|
365 | #define CP_DST_ENDPT m5_i2 /* process to copy to */
|
---|
366 | #define CP_DST_ADDR m5_l2 /* address where data go to */
|
---|
367 | #define CP_NR_BYTES m5_l3 /* number of bytes to copy */
|
---|
368 |
|
---|
369 | /* Field names for SYS_VCOPY and SYS_VVIRCOPY. */
|
---|
370 | #define VCP_NR_OK m1_i2 /* number of successfull copies */
|
---|
371 | #define VCP_VEC_SIZE m1_i3 /* size of copy vector */
|
---|
372 | #define VCP_VEC_ADDR m1_p1 /* pointer to copy vector */
|
---|
373 |
|
---|
374 | /* Field names for SYS_GETINFO. */
|
---|
375 | #define I_REQUEST m7_i3 /* what info to get */
|
---|
376 | # define GET_KINFO 0 /* get kernel information structure */
|
---|
377 | # define GET_IMAGE 1 /* get system image table */
|
---|
378 | # define GET_PROCTAB 2 /* get kernel process table */
|
---|
379 | # define GET_RANDOMNESS 3 /* get randomness buffer */
|
---|
380 | # define GET_MONPARAMS 4 /* get monitor parameters */
|
---|
381 | # define GET_KENV 5 /* get kernel environment string */
|
---|
382 | # define GET_IRQHOOKS 6 /* get the IRQ table */
|
---|
383 | # define GET_KMESSAGES 7 /* get kernel messages */
|
---|
384 | # define GET_PRIVTAB 8 /* get kernel privileges table */
|
---|
385 | # define GET_KADDRESSES 9 /* get various kernel addresses */
|
---|
386 | # define GET_SCHEDINFO 10 /* get scheduling queues */
|
---|
387 | # define GET_PROC 11 /* get process slot if given process */
|
---|
388 | # define GET_MACHINE 12 /* get machine information */
|
---|
389 | # define GET_LOCKTIMING 13 /* get lock()/unlock() latency timing */
|
---|
390 | # define GET_BIOSBUFFER 14 /* get a buffer for BIOS calls */
|
---|
391 | # define GET_LOADINFO 15 /* get load average information */
|
---|
392 | #define I_ENDPT m7_i4 /* calling process */
|
---|
393 | #define I_VAL_PTR m7_p1 /* virtual address at caller */
|
---|
394 | #define I_VAL_LEN m7_i1 /* max length of value */
|
---|
395 | #define I_VAL_PTR2 m7_p2 /* second virtual address */
|
---|
396 | #define I_VAL_LEN2_E m7_i2 /* second length, or proc nr */
|
---|
397 | # define GET_IRQACTIDS 16 /* get the IRQ masks */
|
---|
398 |
|
---|
399 | /* Field names for SYS_TIMES. */
|
---|
400 | #define T_ENDPT m4_l1 /* process to request time info for */
|
---|
401 | #define T_USER_TIME m4_l1 /* user time consumed by process */
|
---|
402 | #define T_SYSTEM_TIME m4_l2 /* system time consumed by process */
|
---|
403 | #define T_CHILD_UTIME m4_l3 /* user time consumed by process' children */
|
---|
404 | #define T_CHILD_STIME m4_l4 /* sys time consumed by process' children */
|
---|
405 | #define T_BOOT_TICKS m4_l5 /* number of clock ticks since boot time */
|
---|
406 |
|
---|
407 | /* vm_map */
|
---|
408 | #define VM_MAP_ENDPT m4_l1
|
---|
409 | #define VM_MAP_MAPUNMAP m4_l2
|
---|
410 | #define VM_MAP_BASE m4_l3
|
---|
411 | #define VM_MAP_SIZE m4_l4
|
---|
412 | #define VM_MAP_ADDR m4_l5
|
---|
413 |
|
---|
414 | /* Field names for SYS_TRACE, SYS_PRIVCTL. */
|
---|
415 | #define CTL_ENDPT m2_i1 /* process number of the caller */
|
---|
416 | #define CTL_REQUEST m2_i2 /* server control request */
|
---|
417 | #define CTL_MM_PRIV m2_i3 /* privilege as seen by PM */
|
---|
418 | #define CTL_ARG_PTR m2_p1 /* pointer to argument */
|
---|
419 | #define CTL_ADDRESS m2_l1 /* address at traced process' space */
|
---|
420 | #define CTL_DATA m2_l2 /* data field for tracing */
|
---|
421 |
|
---|
422 | /* Field names for SYS_KILL, SYS_SIGCTL */
|
---|
423 | #define SIG_REQUEST m2_l2 /* PM signal control request */
|
---|
424 | #define S_GETSIG 0 /* get pending kernel signal */
|
---|
425 | #define S_ENDSIG 1 /* finish a kernel signal */
|
---|
426 | #define S_SENDSIG 2 /* POSIX style signal handling */
|
---|
427 | #define S_SIGRETURN 3 /* return from POSIX handling */
|
---|
428 | #define S_KILL 4 /* servers kills process with signal */
|
---|
429 | #define SIG_ENDPT m2_i1 /* process number for inform */
|
---|
430 | #define SIG_NUMBER m2_i2 /* signal number to send */
|
---|
431 | #define SIG_FLAGS m2_i3 /* signal flags field */
|
---|
432 | #define SIG_MAP m2_l1 /* used by kernel to pass signal bit map */
|
---|
433 | #define SIG_CTXT_PTR m2_p1 /* pointer to info to restore signal context */
|
---|
434 |
|
---|
435 | /* Field names for SYS_FORK, _EXEC, _EXIT, _NEWMAP. */
|
---|
436 | #define PR_ENDPT m1_i1 /* indicates a process */
|
---|
437 | #define PR_PRIORITY m1_i2 /* process priority */
|
---|
438 | #define PR_SLOT m1_i2 /* indicates a process slot */
|
---|
439 | #define PR_PID m1_i3 /* process id at process manager */
|
---|
440 | #define PR_STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
|
---|
441 | #define PR_TRACING m1_i3 /* flag to indicate tracing is on/ off */
|
---|
442 | #define PR_NAME_PTR m1_p2 /* tells where program name is for dmp */
|
---|
443 | #define PR_IP_PTR m1_p3 /* initial value for ip after exec */
|
---|
444 | #define PR_MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
|
---|
445 |
|
---|
446 | /* Field names for SYS_INT86 */
|
---|
447 | #define INT86_REG86 m1_p1 /* pointer to registers */
|
---|
448 |
|
---|
449 | /* Field names for SELECT (FS). */
|
---|
450 | #define SEL_NFDS m8_i1
|
---|
451 | #define SEL_READFDS m8_p1
|
---|
452 | #define SEL_WRITEFDS m8_p2
|
---|
453 | #define SEL_ERRORFDS m8_p3
|
---|
454 | #define SEL_TIMEOUT m8_p4
|
---|
455 |
|
---|
456 | /*===========================================================================*
|
---|
457 | * Messages for the Reincarnation Server *
|
---|
458 | *===========================================================================*/
|
---|
459 |
|
---|
460 | #define RS_RQ_BASE 0x700
|
---|
461 |
|
---|
462 | #define RS_UP (RS_RQ_BASE + 0) /* start system service */
|
---|
463 | #define RS_DOWN (RS_RQ_BASE + 1) /* stop system service */
|
---|
464 | #define RS_REFRESH (RS_RQ_BASE + 2) /* restart system service */
|
---|
465 | #define RS_RESCUE (RS_RQ_BASE + 3) /* set rescue directory */
|
---|
466 | #define RS_SHUTDOWN (RS_RQ_BASE + 4) /* alert about shutdown */
|
---|
467 |
|
---|
468 | # define RS_CMD_ADDR m1_p1 /* command string */
|
---|
469 | # define RS_CMD_LEN m1_i1 /* length of command */
|
---|
470 | # define RS_PID m1_i1 /* pid of system service */
|
---|
471 | # define RS_PERIOD m1_i2 /* heartbeat period */
|
---|
472 | # define RS_DEV_MAJOR m1_i3 /* major device number */
|
---|
473 |
|
---|
474 | /*===========================================================================*
|
---|
475 | * Messages for the Data Store Server *
|
---|
476 | *===========================================================================*/
|
---|
477 |
|
---|
478 | #define DS_RQ_BASE 0x800
|
---|
479 |
|
---|
480 | #define DS_PUBLISH (DS_RQ_BASE + 0) /* publish information */
|
---|
481 | #define DS_RETRIEVE (DS_RQ_BASE + 1) /* retrieve information */
|
---|
482 | #define DS_SUBSCRIBE (DS_RQ_BASE + 2) /* subscribe to information */
|
---|
483 |
|
---|
484 | # define DS_KEY m2_i1 /* key for the information */
|
---|
485 | # define DS_FLAGS m2_i2 /* flags provided by caller */
|
---|
486 | # define DS_AUTH m2_p1 /* authorization of caller */
|
---|
487 | # define DS_VAL_L1 m2_l1 /* first long data value */
|
---|
488 | # define DS_VAL_L2 m2_l2 /* second long data value */
|
---|
489 |
|
---|
490 | /*===========================================================================*
|
---|
491 | * Messages for the Semaphore Server *
|
---|
492 | *===========================================================================*/
|
---|
493 | #define SS_RQ_BASE 0xA00 /* qualsiasi numero inutilizzato e` ok */
|
---|
494 | #define SS_DOWN (SS_RQ_BASE + 0) /* semaphore down */
|
---|
495 | #define SS_UP (SS_RQ_BASE + 1) /* semaphore up */
|
---|
496 |
|
---|
497 |
|
---|
498 |
|
---|
499 | /*===========================================================================*
|
---|
500 | * Miscellaneous messages used by TTY *
|
---|
501 | *===========================================================================*/
|
---|
502 |
|
---|
503 | /* Miscellaneous request types and field names, e.g. used by IS server. */
|
---|
504 | #define FKEY_CONTROL 98 /* control a function key at the TTY */
|
---|
505 | # define FKEY_REQUEST m2_i1 /* request to perform at TTY */
|
---|
506 | # define FKEY_MAP 10 /* observe function key */
|
---|
507 | # define FKEY_UNMAP 11 /* stop observing function key */
|
---|
508 | # define FKEY_EVENTS 12 /* request open key presses */
|
---|
509 | # define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */
|
---|
510 | # define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */
|
---|
511 | #define DIAGNOSTICS 100 /* output a string without FS in between */
|
---|
512 | # define DIAG_PRINT_BUF m1_p1
|
---|
513 | # define DIAG_BUF_COUNT m1_i1
|
---|
514 | # define DIAG_ENDPT m1_i2
|
---|
515 | #define GET_KMESS 101 /* get kmess from TTY */
|
---|
516 | # define GETKM_PTR m1_p1
|
---|
517 |
|
---|
518 |
|
---|
519 | #endif /* _MINIX_COM_H */
|
---|