1 /* This table has one slot per system process. It contains information for
2 * servers and driver needed by the reincarnation server to keep track of
3 * each process' status.
6 /* Space reserved for program and arguments. */
7 #define MAX_COMMAND_LEN 512 /* maximum argument string length */
8 #define MAX_LABEL_LEN 16 /* Unique name of (this instance of)
11 #define MAX_SCRIPT_LEN 256 /* maximum restart script name length */
12 #define MAX_NR_ARGS 4 /* maximum number of arguments */
13 #define MAX_RESCUE_DIR_LEN 64 /* maximum rescue dir length */
15 #define MAX_NR_PCI_ID 4 /* maximum number of PCI device IDs */
16 #define MAX_NR_PCI_CLASS 4 /* maximum number of PCI class IDs */
17 #define MAX_NR_SYSTEM 2 /* should match RSS_NR_SYSTEM */
19 /* Definition of the system process table. This table only has entries for
20 * the servers and drivers, and thus is not directly indexed by slot number.
23 int r_proc_nr_e
; /* process endpoint number */
24 pid_t r_pid
; /* process id, -1 if the process is not there */
25 dev_t r_dev_nr
; /* major device number */
26 int r_dev_style
; /* device style */
28 int r_restarts
; /* number of restarts (initially zero) */
29 long r_backoff
; /* number of periods to wait before revive */
30 unsigned r_flags
; /* status and policy flags */
32 long r_period
; /* heartbeat period (or zero) */
33 clock_t r_check_tm
; /* timestamp of last check */
34 clock_t r_alive_tm
; /* timestamp of last heartbeat */
35 clock_t r_stop_tm
; /* timestamp of SIGTERM signal */
36 endpoint_t r_caller
; /* RS_LATEREPLY caller */
38 char *r_exec
; /* Executable image */
39 size_t r_exec_len
; /* Length of image */
41 char r_label
[MAX_LABEL_LEN
]; /* unique name of this driver */
42 char r_cmd
[MAX_COMMAND_LEN
]; /* raw command plus arguments */
43 char r_script
[MAX_SCRIPT_LEN
]; /* name of the restart script executable */
44 char *r_argv
[MAX_NR_ARGS
+2]; /* parsed arguments vector */
45 int r_argc
; /* number of arguments */
49 struct priv r_priv
; /* Privilege structure to be passed to the
54 int r_nr_pci_id
; /* Number of PCI devices IDs */
55 struct { u16_t vid
; u16_t did
; } r_pci_id
[MAX_NR_PCI_ID
];
56 int r_nr_pci_class
; /* Number of PCI class IDs */
57 struct { u32_t
class; u32_t mask
; } r_pci_class
[MAX_NR_PCI_CLASS
];
59 u32_t r_call_mask
[MAX_NR_SYSTEM
];
60 } rproc
[NR_SYS_PROCS
];
62 /* Mapping for fast access to the system process table. */
63 extern struct rproc
*rproc_ptr
[NR_PROCS
];
66 #define RS_IN_USE 0x001 /* set when process slot is in use */
67 #define RS_EXITING 0x004 /* set when exit is expected */
68 #define RS_REFRESHING 0x008 /* set when refresh must be done */
69 #define RS_NOPINGREPLY 0x010 /* driver failed to reply to a ping request */
70 #define RS_KILLED 0x020 /* driver is killed */
71 #define RS_CRASHED 0x040 /* driver crashed */
72 #define RS_LATEREPLY 0x080 /* no reply sent to RS_DOWN caller yet */
74 /* Constants determining RS period and binary exponential backoff. */
75 #define RS_DELTA_T 60 /* check every T ticks */
76 #define BACKOFF_BITS (sizeof(long)*8) /* bits in backoff field */
77 #define MAX_BACKOFF 30 /* max backoff in RS_DELTA_T */
79 /* Magic process table addresses. */
80 #define BEG_RPROC_ADDR (&rproc[0])
81 #define END_RPROC_ADDR (&rproc[NR_SYS_PROCS])
82 #define NIL_RPROC ((struct mproc *) 0)