make vfs & filesystems use failable copying
[minix3.git] / include / minix / rs.h
blobf5f8621d64c6f2cae6a8f1b7931eeb85404a74f1
1 #ifndef RS_H
2 #define RS_H
4 /*
5 minix/rs.h
7 Interface to the reincarnation server
8 */
10 #include <minix/bitmap.h>
11 #include <minix/com.h>
13 #define SERVICE_LOGIN "service" /* passwd file entry for services */
15 /* RSS definitions. */
16 #define RSS_NR_IRQ 16
17 #define RSS_NR_IO 16
18 #define RSS_IRQ_ALL (RSS_NR_IRQ+1)
19 #define RSS_IO_ALL (RSS_NR_IO+1)
20 #define RSS_IPC_ALL "IPC_ALL"
21 #define RSS_IPC_ALL_SYS "IPC_ALL_SYS"
23 /* RSS flags. */
24 #define RSS_COPY 0x01 /* keep an in-memory copy of the binary */
25 #define RSS_REUSE 0x04 /* Try to reuse previously copied binary */
26 #define RSS_NOBLOCK 0x08 /* unblock caller immediately */
27 #define RSS_REPLICA 0x10 /* keep a replica of the service */
28 #define RSS_SELF_LU 0x20 /* perform self update */
29 #define RSS_SYS_BASIC_CALLS 0x40 /* include basic kernel calls */
30 #define RSS_VM_BASIC_CALLS 0x80 /* include basic vm calls */
31 #define RSS_NO_BIN_EXP 0x100 /* suppress binary exponential offset */
33 /* Common definitions. */
34 #define RS_NR_CONTROL 8
35 #define RS_NR_PCI_DEVICE 32
36 #define RS_NR_PCI_CLASS 4
37 #define RS_MAX_LABEL_LEN 16
39 /* CPU special values */
40 #define RS_CPU_DEFAULT -1 /* use the default cpu or do not change the current one */
41 #define RS_CPU_BSP -2 /* use the bootstrap cpu */
43 /* Labels are copied over separately. */
44 struct rss_label
46 char *l_addr;
47 size_t l_len;
50 struct rs_pci_id {
51 u16_t vid;
52 u16_t did;
53 u16_t sub_vid;
54 u16_t sub_did;
56 #define NO_SUB_VID 0xffff
57 #define NO_SUB_DID 0xffff
59 struct rs_pci_class {
60 u32_t pciclass;
61 u32_t mask;
64 /* Arguments needed to start a new driver or server */
65 struct rs_start
67 unsigned rss_flags;
68 char *rss_cmd;
69 size_t rss_cmdlen;
70 uid_t rss_uid;
71 endpoint_t rss_sigmgr;
72 endpoint_t rss_scheduler;
73 int rss_priority;
74 int rss_quantum;
75 int rss_major;
76 long rss_period;
77 char *rss_script;
78 size_t rss_scriptlen;
79 int rss_nr_irq;
80 int rss_irq[RSS_NR_IRQ];
81 int rss_nr_io;
82 struct { unsigned base; unsigned len; } rss_io[RSS_NR_IO];
83 int rss_nr_pci_id;
84 struct rs_pci_id rss_pci_id[RS_NR_PCI_DEVICE];
85 int rss_nr_pci_class;
86 struct rs_pci_class rss_pci_class[RS_NR_PCI_CLASS];
87 bitchunk_t rss_system[SYS_CALL_MASK_SIZE];
88 struct rss_label rss_label;
89 char *rss_ipc;
90 size_t rss_ipclen;
91 bitchunk_t rss_vm[VM_CALL_MASK_SIZE];
92 int rss_nr_control;
93 struct rss_label rss_control[RS_NR_CONTROL];
94 int devman_id;
96 * SMP specific data
98 * must be at the end of the structure for binary compatibility with
99 * non-smp sysytems
101 int rss_cpu;
104 /* ACL information for access to PCI devices */
105 struct rs_pci
107 char rsp_label[RS_MAX_LABEL_LEN];
108 int rsp_endpoint;
109 int rsp_nr_device;
110 struct rs_pci_id rsp_device[RS_NR_PCI_DEVICE];
111 int rsp_nr_class;
112 struct rs_pci_class rsp_class[RS_NR_PCI_CLASS];
115 /* Definition of a public entry of the system process table. */
116 struct rprocpub {
117 short in_use; /* set when the entry is in use */
118 unsigned sys_flags; /* sys flags */
119 endpoint_t endpoint; /* process endpoint number */
121 devmajor_t dev_nr; /* major device number or NO_DEV */
123 char label[RS_MAX_LABEL_LEN]; /* label of this service */
124 char proc_name[RS_MAX_LABEL_LEN]; /* process name of this service */
126 bitchunk_t vm_call_mask[VM_CALL_MASK_SIZE]; /* vm call mask */
128 struct rs_pci pci_acl; /* pci acl */
129 int devman_id;
132 /* Return whether the given boot process is a user process, as opposed to a
133 * system process. Only usable by core services during SEF initialization.
135 #define IS_RPUB_BOOT_USR(rpub) ((rpub)->endpoint == INIT_PROC_NR)
137 int minix_rs_lookup(const char *name, endpoint_t *value);
139 #endif