1 /* Global constants used in RS.
6 /* Space reserved for program and arguments. */
7 #define MAX_COMMAND_LEN 512 /* maximum argument string length */
8 #define MAX_SCRIPT_LEN 256 /* maximum restart script name length */
9 #define MAX_NR_ARGS 4 /* maximum number of arguments */
11 #define MAX_IPC_LIST 256 /* Max size of list for IPC target
16 #define RS_IN_USE 0x001 /* set when process slot is in use */
17 #define RS_EXITING 0x004 /* set when exit is expected */
18 #define RS_REFRESHING 0x008 /* set when refresh must be done */
19 #define RS_NOPINGREPLY 0x010 /* service failed to reply to a ping request */
20 #define RS_KILLED 0x020 /* service is killed */
21 #define RS_CRASHED 0x040 /* service crashed */
22 #define RS_LATEREPLY 0x080 /* no reply sent to RS_DOWN caller yet */
23 #define RS_SIGNALED 0x100 /* service crashed */
24 #define RS_INITIALIZING 0x200 /* set when init is in progress */
25 #define RS_UPDATING 0x400 /* set when update is in progress */
27 /* Sys flag values. */
28 #define SF_CORE_SRV 0x001 /* set for core system services
29 * XXX FIXME: This should trigger a system
30 * panic when a CORE_SRV service cannot
31 * be restarted. We need better error-handling
32 * in RS to change this.
34 #define SF_SYNCH_BOOT 0X002 /* set when process needs synch boot init */
35 #define SF_NEED_COPY 0x004 /* set when process needs copy to restart */
36 #define SF_USE_COPY 0x008 /* set when process has a copy in memory */
38 /* Constants determining RS period and binary exponential backoff. */
39 #define RS_INIT_T 600 /* allow T ticks for init */
40 #define RS_DELTA_T 60 /* check every T ticks */
41 #define BACKOFF_BITS (sizeof(long)*8) /* bits in backoff field */
42 #define MAX_BACKOFF 30 /* max backoff in RS_DELTA_T */
44 /* Magic process table addresses. */
45 #define BEG_RPROC_ADDR (&rproc[0])
46 #define END_RPROC_ADDR (&rproc[NR_SYS_PROCS])
47 #define NIL_RPROC ((struct mproc *) 0)
49 /* Constants for live update. */
50 #define RS_DEFAULT_PREPARE_MAXTIME 2*RS_DELTA_T /* default prepare max time */
51 #define RS_MAX_PREPARE_MAXTIME 20*RS_DELTA_T /* max prepare max time */
54 /* Definitions for boot info tables. */
55 #define NULL_BOOT_NR NR_BOOT_PROCS /* marks a null boot entry */
56 #define DEFAULT_BOOT_NR NR_BOOT_PROCS /* marks the default boot entry */
57 #define SYS_ALL_C (-1) /* specifies all calls */
58 #define SYS_NULL_C (-2) /* marks a null call entry */
60 /* Define privilege flags for the various process types. */
61 #define SRV_F (SYS_PROC | PREEMPTIBLE) /* system services */
62 #define DSRV_F (SRV_F | DYN_PRIV_ID | CHECK_IO_PORT | CHECK_IRQ)
63 /* dynamic system services */
64 #define VM_F (SYS_PROC) /* vm */
65 #define RUSR_F (BILLABLE | PREEMPTIBLE) /* root user proc */
67 /* Define system call traps for the various process types. These call masks
68 * determine what system call traps a process is allowed to make.
70 #define SRV_T (~0) /* system services */
71 #define DSRV_T SRV_T /* dynamic system services */
72 #define RUSR_T (1 << SENDREC) /* root user proc */
74 /* Send masks determine to whom processes can send messages or notifications. */
75 #define SRV_M (~0) /* system services */
77 ( spi_to(PM_PROC_NR) | spi_to(FS_PROC_NR) | spi_to(RS_PROC_NR) \
78 | spi_to(VM_PROC_NR) ) /* root user proc */
80 /* Define sys flags for the various process types. */
81 #define SRV_SF (SF_CORE_SRV | SF_NEED_COPY) /* system services */
82 #define SRVC_SF (SRV_SF | SF_USE_COPY) /* system services with a copy */
83 #define DSRV_SF (0) /* dynamic system services */
84 #define VM_SF (SRV_SF | SF_SYNCH_BOOT) /* vm */
86 #endif /* RS_CONST_H */