免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6487 | 回复: 3
打印 上一主题 下一主题

进程任务结构体task_struct存放在哪里? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-23 20:57 |只看该作者 |倒序浏览
进程任务结构体task_struct存放在哪里?

论坛徽章:
0
2 [报告]
发表于 2008-05-23 21:55 |只看该作者

  1. /* 2.6.24.4 <asm/thread_info_64.h> */

  2. struct thread_info {
  3.         struct task_struct        *task;                /* main task structure */
  4.         struct exec_domain        *exec_domain;        /* execution domain */
  5.         __u32                        flags;                /* low level flags */
  6.         __u32                        status;                /* thread synchronous flags */
  7.         __u32                        cpu;                /* current CPU */
  8.         int                         preempt_count;        /* 0 => preemptable, <0 => BUG */

  9.         mm_segment_t                addr_limit;       
  10.         struct restart_block    restart_block;
  11. };
  12. #endif

  13. /*
  14. * macros/functions for gaining access to the thread information structure
  15. * preempt_count needs to be 1 initially, until the scheduler is functional.
  16. */
  17. #ifndef __ASSEMBLY__
  18. #define INIT_THREAD_INFO(tsk)                        \
  19. {                                                \
  20.         .task               = &tsk, \  /* sounds here */
  21.         .exec_domain   = &default_exec_domain,        \
  22.         .flags               = 0,                        \
  23.         .cpu               = 0,                        \
  24.         .preempt_count = 1,                        \
  25.         .addr_limit     = KERNEL_DS,                \
  26.         .restart_block = {                        \
  27.                 .fn = do_no_restart_syscall,        \
  28.         },                                        \
  29. }
复制代码

论坛徽章:
0
3 [报告]
发表于 2008-05-24 20:21 |只看该作者
#include <linux/sched.h>

好象是

论坛徽章:
0
4 [报告]
发表于 2008-05-27 09:00 |只看该作者
在进程内核栈的栈顶的内容指向的位置
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP