process.c (98817a84ff1c755c347ac633ff017a623a631fad) process.c (714acdbd1c94e7e3ab90f6b6938f1ccb27b662f0)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * OpenRISC process.c
4 *
5 * Linux architectural port borrowing liberally from similar works of
6 * others. All original copyrights apply as per the original source
7 * declaration.
8 *

--- 102 unchanged lines hidden (view full) ---

111
112/*
113 * Copy the thread-specific (arch specific) info from the current
114 * process to the new one p
115 */
116extern asmlinkage void ret_from_fork(void);
117
118/*
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * OpenRISC process.c
4 *
5 * Linux architectural port borrowing liberally from similar works of
6 * others. All original copyrights apply as per the original source
7 * declaration.
8 *

--- 102 unchanged lines hidden (view full) ---

111
112/*
113 * Copy the thread-specific (arch specific) info from the current
114 * process to the new one p
115 */
116extern asmlinkage void ret_from_fork(void);
117
118/*
119 * copy_thread_tls
119 * copy_thread
120 * @clone_flags: flags
121 * @usp: user stack pointer or fn for kernel thread
122 * @arg: arg to fn for kernel thread; always NULL for userspace thread
123 * @p: the newly created task
124 * @tls: the Thread Local Storage pointer for the new process
125 *
126 * At the top of a newly initialized kernel stack are two stacked pt_reg
127 * structures. The first (topmost) is the userspace context of the thread.

--- 14 unchanged lines hidden (view full) ---

142 * A kernel thread 'fn' may return; this is effectively what happens when
143 * kernel_execve is called. In that case, the userspace pt_regs must have
144 * been initialized (which kernel_execve takes care of, see start_thread
145 * below); ret_from_fork will then continue its execution causing the
146 * 'kernel thread' to return to userspace as a userspace thread.
147 */
148
149int
120 * @clone_flags: flags
121 * @usp: user stack pointer or fn for kernel thread
122 * @arg: arg to fn for kernel thread; always NULL for userspace thread
123 * @p: the newly created task
124 * @tls: the Thread Local Storage pointer for the new process
125 *
126 * At the top of a newly initialized kernel stack are two stacked pt_reg
127 * structures. The first (topmost) is the userspace context of the thread.

--- 14 unchanged lines hidden (view full) ---

142 * A kernel thread 'fn' may return; this is effectively what happens when
143 * kernel_execve is called. In that case, the userspace pt_regs must have
144 * been initialized (which kernel_execve takes care of, see start_thread
145 * below); ret_from_fork will then continue its execution causing the
146 * 'kernel thread' to return to userspace as a userspace thread.
147 */
148
149int
150copy_thread_tls(unsigned long clone_flags, unsigned long usp,
151 unsigned long arg, struct task_struct *p, unsigned long tls)
150copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,
151 struct task_struct *p, unsigned long tls)
152{
153 struct pt_regs *userregs;
154 struct pt_regs *kregs;
155 unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
156 unsigned long top_of_kernel_stack;
157
158 top_of_kernel_stack = sp;
159

--- 114 unchanged lines hidden ---
152{
153 struct pt_regs *userregs;
154 struct pt_regs *kregs;
155 unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
156 unsigned long top_of_kernel_stack;
157
158 top_of_kernel_stack = sp;
159

--- 114 unchanged lines hidden ---