本文共 1087 字,大约阅读时间需要 3 分钟。
int copy_thread_tls(unsigned long clone_flags, unsigned long sp, unsigned long arg, struct task_struct *p, unsigned long tls){ struct pt_regs *childregs = task_pt_regs(p); =>#define task_pt_regs(task) \ ({ \ unsigned long __ptr = (unsigned long)task_stack_page(task); \ __ptr += THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING; \ ((struct pt_regs *)__ptr) - 1; \ }) =>#define task_stack_page(task) ((void *)(task)->stack)}
linux 内核原理学习----80x86保护模式编程二head.s
http://blog.sina.com.cn/s/blog_929354e80101ox0b.htmllinux用户栈和内核栈解析
https://blog.csdn.net/u010383937/article/details/78320646linux内核栈与用户栈
http://blog.chinaunix.net/uid-9185047-id-445158.htmllinux为什么需要内核栈,系统调用时直接使用用户栈不行吗?
https://www.zhihu.com/question/43699081/answer/1060669706linux 进程内核栈
https://zhuanlan.zhihu.com/p/296750228linux内核栈与用户栈
https://blog.51cto.com/19880512/274610Linux 中的各种栈:进程栈 线程栈 内核栈 中断栈
https://blog.csdn.net/yangkuanqaz85988/article/details/52403726内核抢占
https://blog.csdn.net/weixin_37571125/article/details/77773048结合中断上下文切换和进程上下文切换分析Linux内核一般执行过程
https://cnblogs.com/kttme/p/13130448.html