进程创建时线程栈处理
来源:互联网 发布:linux 中文输入法安装 编辑:程序博客网 时间:2024/06/05 08:15
这个函数是跟体系结构相关的。
asmlinkage void ret_from_fork(void) asm("ret_from_fork");
int copy_thread(unsigned long clone_flags, unsigned long stack_start, unsigned long stk_sz, struct task_struct *p){ struct pt_regs *childregs = task_pt_regs(p);
memset(&p->thread.cpu_context, 0, sizeof(struct cpu_context));
if (likely(!(p->flags & PF_KTHREAD))) { *childregs = *current_pt_regs(); childregs->regs[0] = 0;
/* * Read the current TLS pointer from tpidr_el0 as it may be * out-of-sync with the saved value. */ *task_user_tls(p) = read_sysreg(tpidr_el0);
if (stack_start) { if (is_compat_thread(task_thread_info(p))) childregs->compat_sp = stack_start; else childregs->sp = stack_start; }
/* * If a TLS pointer was passed to clone (4th argument), use it * for the new thread. */ if (clone_flags & CLONE_SETTLS) p->thread.tp_value = childregs->regs[3]; } else { memset(childregs, 0, sizeof(struct pt_regs)); childregs->pstate = PSR_MODE_EL1h; if (IS_ENABLED(CONFIG_ARM64_UAO) && cpus_have_cap(ARM64_HAS_UAO)) childregs->pstate |= PSR_UAO_BIT; p->thread.cpu_context.x19 = stack_start; p->thread.cpu_context.x20 = stk_sz; } p->thread.cpu_context.pc = (unsigned long)ret_from_fork; p->thread.cpu_context.sp = (unsigned long)childregs;
ptrace_hw_copy_thread(p);
return 0;}
- 进程创建时线程栈处理
- Linux 创建多进程 & 线程时的进程栈段处理
- 进程创建时信号处理
- 进程创建时IO处理
- 进程创建时cgroup处理
- 进程创建时信号处理函数处理
- 线程、进程 的创建
- 进程创建和线程创建
- 进程创建时内存描述符处理
- 进程创建时命名空间处理
- 进程创建时安全计算处理
- 进程创建时共享内存处理
- 进程及线程创建流程
- 如何创建线程进程 转载
- Linux进程线程学习笔记:进程创建
- Linux进程线程学习笔记:进程创建
- 【进程管理】进程(线程)创建
- Linux进程线程学习笔记:进程创建
- Python 读取 pkl文件
- MySQL查询优化器--非SPJ优化(三)--DISTINCT优化
- Python 错误类型及解决方法
- MySQL查询优化器--非SPJ的优化
- MySQL查询优化器--非SPJ优化(四)--LIMIT优化
- 进程创建时线程栈处理
- PostgreSQL查询优化器--逻辑查询优化--视图优化(一)
- PostgreSQL查询优化器--逻辑查询优化--视图优化(二)
- 数据库使用经验---面对大数据背景
- PostgreSQL查询优化器--逻辑查询优化--视图优化(三)
- 开源数据库的编译---MySQL的编译(For MySQL V5.6.12)
- Spring EL表示式的运用@Value
- PostgreSQL查询优化器--逻辑查询优化--子查询优化(一)
- 迎接2014---跨年礼物送给各位朋友