vm: fix potential null deref
[minix.git] / servers / rs / type.h
blob17e92d1d2cc0faf736af8ad1327f875b5e8d2d8e
1 /* Type definitions used in RS.
2 */
3 #ifndef RS_TYPE_H
4 #define RS_TYPE_H
6 /* Definition of an entry of the boot image priv table. */
7 struct boot_image_priv {
8 endpoint_t endpoint; /* process endpoint number */
9 char label[RS_MAX_LABEL_LEN]; /* label to assign to this service */
11 int flags; /* privilege flags */
14 /* Definition of an entry of the boot image sys table. */
15 struct boot_image_sys {
16 endpoint_t endpoint; /* process endpoint number */
18 int flags; /* system flags */
21 /* Definition of an entry of the boot image dev table. */
22 struct boot_image_dev {
23 endpoint_t endpoint; /* process endpoint number */
25 int flags; /* device flags */
26 dev_t dev_nr; /* major device number */
27 int dev_style; /* device style */
28 int dev_style2; /* device style for next major device number */
31 /* Definition of an entry of the system process table. */
32 struct rproc {
33 struct rprocpub *r_pub; /* pointer to the corresponding public entry */
34 struct rproc *r_old_rp; /* pointer to the slot with the old version */
35 struct rproc *r_new_rp; /* pointer to the slot with the new version */
36 struct rproc *r_prev_rp; /* pointer to the slot with the prev replica */
37 struct rproc *r_next_rp; /* pointer to the slot with the next replica */
38 pid_t r_pid; /* process id, -1 if the process is not there */
40 int r_restarts; /* number of restarts (initially zero) */
41 long r_backoff; /* number of periods to wait before revive */
42 unsigned r_flags; /* status and policy flags */
44 long r_period; /* heartbeat period (or zero) */
45 clock_t r_check_tm; /* timestamp of last check */
46 clock_t r_alive_tm; /* timestamp of last heartbeat */
47 clock_t r_stop_tm; /* timestamp of SIGTERM signal */
48 endpoint_t r_caller; /* RS_LATEREPLY caller */
49 int r_caller_request; /* RS_LATEREPLY caller request */
51 char r_cmd[MAX_COMMAND_LEN]; /* raw command plus arguments */
52 char r_args[MAX_COMMAND_LEN]; /* null-separated raw command plus arguments */
53 #define ARGV_ELEMENTS (MAX_NR_ARGS+2) /* path, args, null */
54 char *r_argv[ARGV_ELEMENTS];
55 int r_argc; /* number of arguments */
56 char r_script[MAX_SCRIPT_LEN]; /* name of the restart script executable */
58 char *r_exec; /* Executable image */
59 size_t r_exec_len; /* Length of image */
61 struct priv r_priv; /* Privilege structure to be passed to the
62 * kernel.
64 uid_t r_uid;
65 endpoint_t r_scheduler; /* scheduler */
66 int r_priority; /* negative values are reserved for special meanings */
67 int r_quantum;
68 int r_cpu;
70 /* Backup values from the privilege structure. */
71 struct io_range r_io_tab[NR_IO_RANGE];
72 int r_nr_io_range;
73 int r_irq_tab[NR_IRQ];
74 int r_nr_irq;
76 char r_ipc_list[MAX_IPC_LIST];
77 int r_nr_control;
78 char r_control[RS_NR_CONTROL][RS_MAX_LABEL_LEN];
81 /* Definition of the global update descriptor. */
82 struct rupdate {
83 int flags; /* flags to keep track of the status of the update */
84 clock_t prepare_tm; /* timestamp of when the update was scheduled */
85 clock_t prepare_maxtime; /* max time to wait for the process to be ready */
86 struct rproc *rp; /* the process under update */
89 #endif /* RS_TYPE_H */