int
copy_thread(unsigned long clone_flags, unsigned long usp,
unsigned long arg,
- struct task_struct *p, struct pt_regs *wontuse)
+ struct task_struct *p)
{
extern void ret_from_fork(void);
extern void ret_from_kernel_thread(void);
int
copy_thread(unsigned long clone_flags, unsigned long stack_start,
- unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused)
+ unsigned long stk_sz, struct task_struct *p)
{
struct thread_info *thread = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
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 *unused)
+ unsigned long stk_sz, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
unsigned long tls = p->thread.tp_value;
int copy_thread(unsigned long clone_flags, unsigned long usp,
unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
int
copy_thread(unsigned long clone_flags,
unsigned long usp, unsigned long topstk,
- struct task_struct *p, struct pt_regs *regs)
+ struct task_struct *p)
{
struct pt_regs *childregs;
unsigned long *v;
childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1;
v = ((unsigned long *)childregs) - 2;
- if (unlikely(!regs)) {
+ if (unlikely(p->flags & PF_KTHREAD)) {
memset(childregs, 0, sizeof(struct pt_regs));
v[0] = usp;
v[1] = topstk;
__asm__ __volatile__("%0 = syscfg;":"=da"(childregs->syscfg):);
p->thread.usp = 0;
} else {
- *childregs = *regs;
+ *childregs = *current_pt_regs();
childregs->r0 = 0;
p->thread.usp = usp ? : rdusp();
v[0] = v[1] = 0;
*/
int copy_thread(unsigned long clone_flags, unsigned long usp,
unsigned long ustk_size,
- struct task_struct *p, struct pt_regs *unused)
+ struct task_struct *p)
{
struct pt_regs *childregs;
asmlinkage void ret_from_kernel_thread(void);
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
struct switch_stack *swstack = ((struct switch_stack *)childregs) - 1;
int
copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
struct switch_stack *swstack = ((struct switch_stack *) childregs) - 1;
*/
int copy_thread(unsigned long clone_flags,
unsigned long usp, unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ struct task_struct *p)
{
struct pt_regs *childregs;
int copy_thread(unsigned long clone_flags,
unsigned long usp, unsigned long topstk,
- struct task_struct * p, struct pt_regs *unused)
+ struct task_struct * p)
{
struct pt_regs * childregs;
* Copy architecture-specific thread state
*/
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg, struct task_struct *p,
- struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
struct hexagon_switch_stack *ss;
int
copy_thread(unsigned long clone_flags,
unsigned long user_stack_base, unsigned long user_stack_size,
- struct task_struct *p, struct pt_regs *regs)
+ struct task_struct *p)
{
extern char ia64_ret_from_clone;
struct switch_stack *child_stack, *stack;
unsigned long rbs, child_rbs, rbs_size;
struct pt_regs *child_ptregs;
+ struct pt_regs *regs = current_pt_regs();
int retval = 0;
child_ptregs = (struct pt_regs *) ((unsigned long) p + IA64_STK_OFFSET) - 1;
}
int copy_thread(unsigned long clone_flags, unsigned long spu,
- unsigned long arg, struct task_struct *tsk, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *tsk)
{
struct pt_regs *childregs = task_pt_regs(tsk);
extern void ret_from_fork(void);
}
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct * p, struct pt_regs * unused)
+ unsigned long arg, struct task_struct *p)
{
struct fork_frame {
struct switch_stack sw;
}
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
struct thread_info *ti = task_thread_info(p);
}
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg, struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
- struct pt_regs *childregs;
+ struct pt_regs *childregs, *regs = current_pt_regs();
unsigned long childksp;
p->set_child_tid = p->clear_child_tid = NULL;
*/
int copy_thread(unsigned long clone_flags,
unsigned long c_usp, unsigned long ustk_size,
- struct task_struct *p, struct pt_regs *unused)
+ struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
struct pt_regs *c_regs;
int
copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg, struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *userregs;
struct pt_regs *kregs;
int
copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
- struct pt_regs * cregs = &(p->thread.regs);
+ struct pt_regs *cregs = &(p->thread.regs);
void *stack = task_stack_page(p);
/* We have to use void * instead of a function pointer, because
extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg, struct task_struct *p,
- struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *childregs, *kregs;
extern void ret_from_fork(void);
ti->flags |= _TIF_RESTOREALL;
f = ret_from_kernel_thread;
} else {
+ struct pt_regs *regs = current_pt_regs();
CHECK_FULL_REGS(regs);
*childregs = *regs;
if (usp)
}
int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti;
struct fake_frame
* set up the kernel stack and exception frames for a new process
*/
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
+ struct pt_regs *regs = current_pt_regs();
p->thread.reg0 = (unsigned long) childregs;
if (unlikely(p->flags & PF_KTHREAD)) {
asmlinkage void ret_from_kernel_thread(void);
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
struct pt_regs *childregs;
asmlinkage void ret_from_kernel_thread(void);
int copy_thread(unsigned long clone_flags, unsigned long usp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
- struct pt_regs *childregs;
+ struct pt_regs *childregs, *regs = current_pt_regs();
#ifdef CONFIG_SH_FPU
/* can't happen for a kernel thread */
extern void ret_from_kernel_thread(void);
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *ti = task_thread_info(p);
- struct pt_regs *childregs;
+ struct pt_regs *childregs, *regs = current_pt_regs();
char *new_stack;
#ifndef CONFIG_SMP
* Child --> %o0 == parents pid, %o1 == 1
*/
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
struct thread_info *t = task_thread_info(p);
+ struct pt_regs *regs = current_pt_regs();
struct sparc_stackf *parent_sf;
unsigned long child_stack_sz;
char *child_trap_frame;
static void save_arch_state(struct thread_struct *t);
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
- struct pt_regs *childregs = task_pt_regs(p);
+ struct pt_regs *childregs = task_pt_regs(p), *regs = current_pt_regs();
unsigned long ksp;
unsigned long *callee_regs;
}
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg, struct task_struct * p,
- struct pt_regs *regs)
+ unsigned long arg, struct task_struct * p)
{
void (*handler)(void);
int kthread = current->flags & PF_KTHREAD;
int
copy_thread(unsigned long clone_flags, unsigned long stack_start,
- unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused)
+ unsigned long stk_sz, struct task_struct *p)
{
struct thread_info *thread = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
}
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
struct task_struct *tsk;
}
int copy_thread(unsigned long clone_flags, unsigned long sp,
- unsigned long arg,
- struct task_struct *p, struct pt_regs *regs)
+ unsigned long arg, struct task_struct *p)
{
int err;
struct pt_regs *childregs;
*/
int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
- unsigned long thread_fn_arg,
- struct task_struct *p, struct pt_regs *unused)
+ unsigned long thread_fn_arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);
extern struct mm_struct *dup_mm(struct task_struct *tsk);
extern int copy_thread(unsigned long, unsigned long, unsigned long,
- struct task_struct *, struct pt_regs *);
+ struct task_struct *);
extern void flush_thread(void);
extern void exit_thread(void);
retval = copy_io(clone_flags, p);
if (retval)
goto bad_fork_cleanup_namespaces;
- retval = copy_thread(clone_flags, stack_start, stack_size, p, regs);
+ retval = copy_thread(clone_flags, stack_start, stack_size, p);
if (retval)
goto bad_fork_cleanup_io;