1 /* This table has one slot per process. It contains all the process management
2 * information for each process. Among other things, it defines the text, data
3 * and stack segments, uids and gids, and various flags. The kernel and file
4 * systems have tables that are also indexed by process, with the contents
5 * of corresponding slots referring to the same process in all three.
11 /* Needs to be included here, for 'ps' etc */
15 char mp_exitstatus
; /* storage for status when process exits */
16 char mp_sigstatus
; /* storage for signal # for killed procs */
17 pid_t mp_pid
; /* process id */
18 endpoint_t mp_endpoint
; /* kernel endpoint id */
19 pid_t mp_procgrp
; /* pid of process group (used for signals) */
20 pid_t mp_wpid
; /* pid this process is waiting for */
21 int mp_parent
; /* index of parent process */
22 int mp_tracer
; /* index of tracer process, or NO_TRACER */
24 /* Child user and system times. Accounting done on child exit. */
25 clock_t mp_child_utime
; /* cumulative user time of children */
26 clock_t mp_child_stime
; /* cumulative sys time of children */
28 /* Real and effective uids and gids. */
29 uid_t mp_realuid
; /* process' real uid */
30 uid_t mp_effuid
; /* process' effective uid */
31 gid_t mp_realgid
; /* process' real gid */
32 gid_t mp_effgid
; /* process' effective gid */
34 /* Supplemental groups. */
35 int mp_ngroups
; /* number of supplemental groups */
36 gid_t mp_sgroups
[NGROUPS_MAX
];/* process' supplemental groups */
38 /* Signal handling information. */
39 sigset_t mp_ignore
; /* 1 means ignore the signal, 0 means don't */
40 sigset_t mp_catch
; /* 1 means catch the signal, 0 means don't */
41 sigset_t mp_sigmask
; /* signals to be blocked */
42 sigset_t mp_sigmask2
; /* saved copy of mp_sigmask */
43 sigset_t mp_sigpending
; /* pending signals to be handled */
44 sigset_t mp_sigtrace
; /* signals to hand to tracer first */
45 struct sigaction mp_sigact
[_NSIG
]; /* as in sigaction(2) */
46 vir_bytes mp_sigreturn
; /* address of C library __sigreturn function */
47 struct timer mp_timer
; /* watchdog timer for alarm(2), setitimer(2) */
48 clock_t mp_interval
[NR_ITIMERS
]; /* setitimer(2) repetition intervals */
50 unsigned mp_flags
; /* flag bits */
51 unsigned mp_trace_flags
; /* trace options */
52 vir_bytes mp_procargs
; /* ptr to proc's initial stack arguments */
53 message mp_reply
; /* reply message to be sent to one */
55 /* Scheduling priority. */
56 signed int mp_nice
; /* nice is PRIO_MIN..PRIO_MAX, standard 0. */
58 /* User space scheduling */
59 int mp_max_priority
; /* this process' highest allowed priority */
60 int mp_priority
; /* the process' current priority */
61 int mp_time_slice
; /* this process's scheduling queue */
63 char mp_name
[PROC_NAME_LEN
]; /* process name */
67 #define IN_USE 0x00001 /* set when 'mproc' slot in use */
68 #define WAITING 0x00002 /* set by WAIT system call */
69 #define ZOMBIE 0x00004 /* waiting for parent to issue WAIT call */
70 #define PAUSED 0x00008 /* set by PAUSE system call */
71 #define ALARM_ON 0x00010 /* set when SIGALRM timer started */
72 #define EXITING 0x00020 /* set by EXIT, process is now exiting */
73 #define TOLD_PARENT 0x00040 /* parent wait() completed, ZOMBIE off */
74 #define STOPPED 0x00080 /* set if process stopped for tracing */
75 #define SIGSUSPENDED 0x00100 /* set by SIGSUSPEND system call */
76 #define REPLY 0x00200 /* set if a reply message is pending */
77 #define FS_CALL 0x00400 /* set if waiting for FS (normal calls) */
78 #define PM_SIG_PENDING 0x00800 /* process got a signal while waiting for FS */
79 #define UNPAUSED 0x01000 /* process is not in a blocking call */
80 #define PRIV_PROC 0x02000 /* system process, special privileges */
81 #define PARTIAL_EXEC 0x04000 /* process got a new map but no content */
82 #define TRACE_EXIT 0x08000 /* tracer is forcing this process to exit */
83 #define TRACE_ZOMBIE 0x10000 /* waiting for tracer to issue WAIT call */
84 #define DELAY_CALL 0x20000 /* waiting for call before sending signal */
85 #define PM_SCHEDULED 0x40000 /* this process is scheduled by PM */
87 #define NIL_MPROC ((struct mproc *) 0)