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.
10 struct mem_map mp_seg
[NR_LOCAL_SEGS
]; /* points to text, data, stack */
11 char mp_exitstatus
; /* storage for status when process exits */
12 char mp_sigstatus
; /* storage for signal # for killed procs */
13 pid_t mp_pid
; /* process id */
14 endpoint_t mp_endpoint
; /* kernel endpoint id */
15 pid_t mp_procgrp
; /* pid of process group (used for signals) */
16 pid_t mp_wpid
; /* pid this process is waiting for */
17 int mp_parent
; /* index of parent process */
19 /* Child user and system times. Accounting done on child exit. */
20 clock_t mp_child_utime
; /* cumulative user time of children */
21 clock_t mp_child_stime
; /* cumulative sys time of children */
23 /* Real and effective uids and gids. */
24 uid_t mp_realuid
; /* process' real uid */
25 uid_t mp_effuid
; /* process' effective uid */
26 gid_t mp_realgid
; /* process' real gid */
27 gid_t mp_effgid
; /* process' effective gid */
29 /* File identification for sharing. */
30 ino_t mp_ino
; /* inode number of file */
31 dev_t mp_dev
; /* device number of file system */
32 time_t mp_ctime
; /* inode changed time */
34 /* Signal handling information. */
35 sigset_t mp_ignore
; /* 1 means ignore the signal, 0 means don't */
36 sigset_t mp_catch
; /* 1 means catch the signal, 0 means don't */
37 sigset_t mp_sig2mess
; /* 1 means transform into notify message */
38 sigset_t mp_sigmask
; /* signals to be blocked */
39 sigset_t mp_sigmask2
; /* saved copy of mp_sigmask */
40 sigset_t mp_sigpending
; /* pending signals to be handled */
41 struct sigaction mp_sigact
[_NSIG
+ 1]; /* as in sigaction(2) */
42 vir_bytes mp_sigreturn
; /* address of C library __sigreturn function */
43 struct sigmsg mp_sigmsg
; /* Save the details of the signal until the
44 * PM_UNPAUSE request is delivered.
46 struct timer mp_timer
; /* watchdog timer for alarm(2) */
48 /* Backwards compatibility for signals. */
49 sighandler_t mp_func
; /* all sigs vectored to a single user fcn */
51 unsigned mp_flags
; /* flag bits */
52 vir_bytes mp_procargs
; /* ptr to proc's initial stack arguments */
53 struct mproc
*mp_swapq
; /* queue of procs waiting to be swapped in */
54 message mp_reply
; /* reply message to be sent to one */
56 /* Communication with FS */
57 int mp_fs_call
; /* Record the call for normal system calls */
58 int mp_fs_call2
; /* Record the call for signals */
59 char *mp_exec_path
; /* Path of executable */
60 vir_bytes mp_exec_path_len
; /* Length of path (including nul) */
61 char *mp_exec_frame
; /* Arguments */
62 vir_bytes mp_exec_frame_len
; /* Length of arguments */
64 /* Scheduling priority. */
65 signed int mp_nice
; /* nice is PRIO_MIN..PRIO_MAX, standard 0. */
67 char mp_name
[PROC_NAME_LEN
]; /* process name */
71 #define IN_USE 0x001 /* set when 'mproc' slot in use */
72 #define WAITING 0x002 /* set by WAIT system call */
73 #define ZOMBIE 0x004 /* set by EXIT, cleared by WAIT */
74 #define PAUSED 0x008 /* set by PAUSE system call */
75 #define ALARM_ON 0x010 /* set when SIGALRM timer started */
76 #define SEPARATE 0x020 /* set if file is separate I & D space */
77 #define TRACED 0x040 /* set if process is to be traced */
78 #define STOPPED 0x080 /* set if process stopped for tracing */
79 #define SIGSUSPENDED 0x100 /* set by SIGSUSPEND system call */
80 #define REPLY 0x200 /* set if a reply message is pending */
81 #define ONSWAP 0x400 /* set if data segment is swapped out */
82 #define SWAPIN 0x800 /* set if on the "swap this in" queue */
83 #define DONT_SWAP 0x1000 /* never swap out this process */
84 #define PRIV_PROC 0x2000 /* system process, special privileges */
85 #define PM_SIG_PENDING 0x4000 /* process got a signal while waiting for FS */
86 #define PARTIAL_EXEC 0x8000 /* Process got a new map but no content */
87 #define TOLD_PARENT 0x10000 /* Parent wait() completed, ZOMBIE off */
89 #define NIL_MPROC ((struct mproc *) 0)