structtask_struct { /* these are hardcoded - don't touch */ volatilelong state; /* -1 unrunnable, 0 runnable, >0 stopped */ unsignedlong flags; /* per process flags, defined below */ int sigpending; mm_segment_t addr_limit; /* thread address space: 0-0xBFFFFFFF for user-thead 0-0xFFFFFFFF for kernel-thread */ structexec_domain *exec_domain; long need_resched; /* various fields */ long counter; long priority; cycles_t avg_slice; /* SMP and runqueue state */ int has_cpu; int processor; int last_processor; int lock_depth; /* Lock depth. We can context switch in and out of holding a syscall kernel lock... */ structtask_struct *next_task, *prev_task; structtask_struct *next_run, *prev_run; /* task state */ structlinux_binfmt *binfmt; int exit_code, exit_signal; int pdeath_signal; /* The signal sent when the parent dies */ /* ??? */ unsignedlong personality; int dumpable:1; int did_exec:1; pid_t pid; pid_t pgrp; pid_t tty_old_pgrp; pid_t session; /* boolean value for session group leader */ int leader; /* * pointers to (original) parent process, youngest child, younger sibling, * older sibling, respectively. (p->father can be replaced with * p->p_pptr->pid) */ structtask_struct *p_opptr, *p_pptr, *p_cptr, *p_ysptr, *p_osptr; /* PID hash table linkage. */ structtask_struct *pidhash_next; structtask_struct **pidhash_pprev; /* Pointer to task[] array linkage. */ structtask_struct **tarray_ptr; structwait_queue *wait_chldexit;/* for wait4() */ structsemaphore *vfork_sem;/* for vfork() */ unsignedlong policy, rt_priority; unsignedlong it_real_value, it_prof_value, it_virt_value; unsignedlong it_real_incr, it_prof_incr, it_virt_incr; structtimer_listreal_timer; structtmstimes; unsignedlong start_time; long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS]; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsignedlong min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; unsignedlong swap_address; unsignedlong swap_cnt; /* number of pages to swap on next pass */ /* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; int ngroups; gid_t groups[NGROUPS]; kernel_cap_t cap_effective, cap_inheritable, cap_permitted; structuser_struct *user; /* limits */ structrlimitrlim[RLIM_NLIMITS]; unsignedshort used_math; char comm[16]; /* file system info */ int link_count; structtty_struct *tty;/* NULL if no tty */ /* ipc stuff */ structsem_undo *semundo; structsem_queue *semsleeping; /* tss for this task */ structthread_structtss; /* filesystem information */ structfs_struct *fs; /* open file information */ structfiles_struct *files; /* memory management info */ structmm_struct *mm; /* signal handlers */ spinlock_t sigmask_lock; /* Protects signal and blocked */ structsignal_struct *sig; sigset_t signal, blocked; structsignal_queue *sigqueue, **sigqueue_tail; unsignedlong sas_ss_sp; size_t sas_ss_size; };
structmm_struct { structvm_area_struct *mmap;/* list of VMAs */ structvm_area_struct *mmap_avl;/* tree of VMAs */ structvm_area_struct *mmap_cache;/* last find_vma result */ pgd_t * pgd; atomic_t count; int map_count; /* number of VMAs */ structsemaphoremmap_sem; unsignedlong context; unsignedlong start_code, end_code, start_data, end_data; unsignedlong start_brk, brk, start_stack; unsignedlong arg_start, arg_end, env_start, env_end; unsignedlong rss, total_vm, locked_vm; unsignedlong def_flags; unsignedlong cpu_vm_mask; /* * This is an architecture-specific pointer: the portable * part of Linux does not know about any segments. */ void * segments; };
structvm_area_struct { structmm_struct * vm_mm;/* VM area parameters */ unsignedlong vm_start; unsignedlong vm_end;
/* linked list of VM areas per task, sorted by address */ structvm_area_struct *vm_next;
pgprot_t vm_page_prot; unsignedshort vm_flags;
/* AVL tree of VM areas per task, sorted by address */ short vm_avl_height; structvm_area_struct * vm_avl_left; structvm_area_struct * vm_avl_right;
/* For areas with inode, the list inode->i_mmap, for shm areas, * the list of attaches, otherwise unused. */ structvm_area_struct *vm_next_share; structvm_area_struct **vm_pprev_share;