source: tags/minix3.1.2a-orig/minix/include/minix/com.h @ 13

Last change on this file since 13 was 13, checked in by monga, 8 years ago

Server semaforo

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