The pm's process table begins with an array of 3 mem_map's:
EXTERN struct mproc { struct mem_map mp_seg[NR_LOCAL_SEGS]; /* points to text, data, stack */ char mp_exitstatus;/* storage for status when process exits */ char mp_sigstatus;/* storage for signal # for killed procs */ pid_t mp_pid;/* process id */ ... mp_seg[0] is for the text segment, mp_seg[1] is for the data segment, mp_seg[2] is for the stack segment.
There are #defines for 0,1, and 2 to help avoid getting the segments mixed up:
#define NR_LOCAL_SEGS 3/* # local segments per process (fixed) */ #define T 0/* proc[i].mem_map[T] is for text */ #define D 1/* proc[i].mem_map[D] is for data */ #define S 2/* proc[i].mem_map[S] is for stack */