1 /* Global constants used in RS.
6 #define DEBUG_DEFAULT 0
7 #define PRIV_DEBUG_DEFAULT 0
10 #define DEBUG DEBUG_DEFAULT
14 #define PRIV_DEBUG PRIV_DEBUG_DEFAULT
17 /* Space reserved for program and arguments. */
18 #define MAX_COMMAND_LEN 512 /* maximum argument string length */
19 #define MAX_SCRIPT_LEN 256 /* maximum restart script name length */
20 #define MAX_NR_ARGS 10 /* maximum number of arguments */
22 #define MAX_IPC_LIST 256 /* Max size of list for IPC target
27 #define RS_IN_USE 0x001 /* set when process slot is in use */
28 #define RS_EXITING 0x002 /* set when exit is expected */
29 #define RS_REFRESHING 0x004 /* set when refresh must be done */
30 #define RS_NOPINGREPLY 0x008 /* service failed to reply to a ping request */
31 #define RS_TERMINATED 0x010 /* service has terminated */
32 #define RS_LATEREPLY 0x020 /* no reply sent to RS_DOWN caller yet */
33 #define RS_INITIALIZING 0x040 /* set when init is in progress */
34 #define RS_UPDATING 0x080 /* set when update is in progress */
35 #define RS_ACTIVE 0x100 /* set for the active instance of a service */
36 #define RS_REINCARNATE 0x200 /* after exit, restart with a new endpoint */
38 /* Sys flag values. */
39 #define SF_CORE_SRV 0x001 /* set for core system services */
40 #define SF_SYNCH_BOOT 0X002 /* set when process needs synch boot init */
41 #define SF_NEED_COPY 0x004 /* set when process needs copy to start */
42 #define SF_USE_COPY 0x008 /* set when process has a copy in memory */
43 #define SF_NEED_REPL 0x010 /* set when process needs replica to start */
44 #define SF_USE_REPL 0x020 /* set when process has a replica */
46 (SF_CORE_SRV | SF_SYNCH_BOOT | SF_NEED_COPY | SF_NEED_REPL) /* immutable */
48 /* Constants determining RS period and binary exponential backoff. */
49 #define RS_INIT_T (system_hz * 10) /* allow T ticks for init */
50 #define RS_DELTA_T (system_hz) /* check every T ticks */
51 #define BACKOFF_BITS (sizeof(long)*8) /* bits in backoff field */
52 #define MAX_BACKOFF 30 /* max backoff in RS_DELTA_T */
54 /* Magic process table addresses. */
55 #define BEG_RPROC_ADDR (&rproc[0])
56 #define END_RPROC_ADDR (&rproc[NR_SYS_PROCS])
58 /* Constants for live update. */
59 #define RS_DEFAULT_PREPARE_MAXTIME 2*RS_DELTA_T /* default prepare max time */
60 #define RS_MAX_PREPARE_MAXTIME 20*RS_DELTA_T /* max prepare max time */
63 /* Definitions for boot info tables. */
64 #define NULL_BOOT_NR NR_BOOT_PROCS /* marks a null boot entry */
65 #define DEFAULT_BOOT_NR NR_BOOT_PROCS /* marks the default boot entry */
67 /* Define sys flags for the various process types. */
68 #define SRV_SF (SF_CORE_SRV) /* system services */
69 #define SRVR_SF (SRV_SF | SF_NEED_REPL) /* services needing a replica */
70 #define DSRV_SF (0) /* dynamic system services */
71 #define VM_SF (SRVR_SF) /* vm */
73 /* Define device flags for the various process types. */
74 #define SRV_DF (DRV_FORCED) /* system services */
75 #define DSRV_DF (SRV_DF) /* dynamic system services */
78 #define SRV_OR_USR(rp, X, Y) (rp->r_priv.s_flags & SYS_PROC ? X : Y)
81 #define RS_DONTREPLY 0
88 #endif /* RS_CONST_H */