大佬教程收集整理的这篇文章主要介绍了linux – task_struct存储在哪里?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
如果您提供一些参考资料,我将不胜感激.
#define alloc_task_struct_node(nodE) \ kmem_cache_alloc_node(task_struct_cachep,GFP_KERNEL,nodE) static struct kmem_cache *task_struct_cachep;
存储指向当前线程的指针的位置取决于体系结构.例如,这是x86(arch / x86 / include / asm / current.h)的工作原理:
static __always_inline struct task_struct *get_current(void) { return percpu_read_stable(current_task); }
在PowerPC中(arch / powerpc / include / asm / current.h):
static inline struct task_struct *get_current(void) { struct task_struct *task; __asm__ __volatile__("ld %0,%1(13)" : "=r" (task) : "i" (offsetof(struct paca_struct,__current))); return task; }
您可以使用Elixir Cross Reference轻松浏览内核源代码.
以上是大佬教程为你收集整理的linux – task_struct存储在哪里?全部内容,希望文章能够帮你解决linux – task_struct存储在哪里?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。