linux任务数据结构实验,Linux核心数据结构--进程或任务

struct task_struct{

/* these are hardcoded - don't touch */

volatile long        state;         /* -1 unrunnable, 0 runnable, >0 stopped */

long                 counter;

long                 priority;

unsigned             long signal;

unsigned             long blocked;   /* bitmap of masked signals */

unsigned             long flags;     /* per process flags, defined below */

int errno;

long                 debugreg[8];  /* Hardware debugging registers */

struct exec_domain   *exec_domain;

/* various fields */

struct linux_binfmt  *binfmt;

struct task_struct   *next_task, *prev_task;

struct task_struct   *next_run,  *prev_run;

unsigned long        saved_kernel_stack;

unsigned long        kernel_stack_page;

int                  exit_code, exit_signal;

/* ??? 这里的注释不知道是什么?*/

unsigned long        personality;

int                  dumpable:1;

int                  did_exec:1;

int                  pid;

int                  pgrp;

int                  tty_old_pgrp;

int                  session;

/* boolean value for session group leader */

int                  leader;

int                  groups[NGROUPS];

/*

* pointers to (original) parent process, youngest child, younger sibling,

* older sibling, respectively.  (p->father can be replaced with

* p->p_pptr->pid)

*/

struct task_struct   *p_opptr, *p_pptr, *p_cptr,

*p_ysptr, *p_osptr;

struct wait_queue    *wait_chldexit;

unsigned short       uid,euid,suid,fsuid;

unsigned short       gid,egid,sgid,fsgid;

unsigned long        timeout, policy, rt_priority;

unsigned long        it_real_value, it_prof_value, it_virt_value;

unsigned long        it_real_incr, it_prof_incr, it_virt_incr;

struct timer_list    real_timer;

long                 utime, stime, cutime, cstime, start_time;

/* mm fault and swap info: this can arguably be seen as either

mm-specific or thread-specific */

unsigned long        min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;

int swappable:1;

unsigned long        swap_address;

unsigned long        old_maj_flt;    /* old value of maj_flt */

unsigned long        dec_flt;        /* page fault count of the last time */

unsigned long        swap_cnt;      /* number of pages to swap on next pass */

/* limits */

struct rlimit        rlim[RLIM_NLIMITS];

unsigned short       used_math;

char                 comm[16];

/* file system info */

int                  link_count;

struct tty_struct    *tty;          /* NULL if no tty */

/* ipc stuff */

struct sem_undo      *semundo;

struct sem_queue     *semsleeping;

/* ldt for this task - used by Wine.  If NULL, default_ldt is used */

struct desc_struct *ldt;

/* tss for this task */

struct thread_struct tss;

/* filesystem information */

struct fs_struct     *fs;

/* open file information */

struct files_struct  *files;

/* memory management info */

struct mm_struct     *mm;

/* signal handlers */

struct signal_struct *sig;

#ifdef __SMP__

int                  processor;

int                  last_processor;

int                  lock_depth;    /* Lock depth.

We can context switch in and out

of holding a syscall kernel lock... */

#endif

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值