Commit 6eca8933 authored by Alex Dowad's avatar Alex Dowad Committed by Michael Ellerman

powerpc/kernel: Rename copy_thread() 'arg' argument to 'kthread_arg'

The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity.
Signed-off-by: default avatarAlex Dowad <alexinbeijing@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent a908f5de
...@@ -1114,8 +1114,11 @@ static void setup_ksp_vsid(struct task_struct *p, unsigned long sp) ...@@ -1114,8 +1114,11 @@ static void setup_ksp_vsid(struct task_struct *p, unsigned long sp)
*/ */
extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */ extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */
/*
* Copy architecture-specific thread state
*/
int copy_thread(unsigned long clone_flags, unsigned long usp, int copy_thread(unsigned long clone_flags, unsigned long usp,
unsigned long arg, struct task_struct *p) unsigned long kthread_arg, struct task_struct *p)
{ {
struct pt_regs *childregs, *kregs; struct pt_regs *childregs, *kregs;
extern void ret_from_fork(void); extern void ret_from_fork(void);
...@@ -1127,6 +1130,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, ...@@ -1127,6 +1130,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
sp -= sizeof(struct pt_regs); sp -= sizeof(struct pt_regs);
childregs = (struct pt_regs *) sp; childregs = (struct pt_regs *) sp;
if (unlikely(p->flags & PF_KTHREAD)) { if (unlikely(p->flags & PF_KTHREAD)) {
/* kernel thread */
struct thread_info *ti = (void *)task_stack_page(p); struct thread_info *ti = (void *)task_stack_page(p);
memset(childregs, 0, sizeof(struct pt_regs)); memset(childregs, 0, sizeof(struct pt_regs));
childregs->gpr[1] = sp + sizeof(struct pt_regs); childregs->gpr[1] = sp + sizeof(struct pt_regs);
...@@ -1137,11 +1141,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, ...@@ -1137,11 +1141,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
clear_tsk_thread_flag(p, TIF_32BIT); clear_tsk_thread_flag(p, TIF_32BIT);
childregs->softe = 1; childregs->softe = 1;
#endif #endif
childregs->gpr[15] = arg; childregs->gpr[15] = kthread_arg;
p->thread.regs = NULL; /* no user register state */ p->thread.regs = NULL; /* no user register state */
ti->flags |= _TIF_RESTOREALL; ti->flags |= _TIF_RESTOREALL;
f = ret_from_kernel_thread; f = ret_from_kernel_thread;
} else { } else {
/* user thread */
struct pt_regs *regs = current_pt_regs(); struct pt_regs *regs = current_pt_regs();
CHECK_FULL_REGS(regs); CHECK_FULL_REGS(regs);
*childregs = *regs; *childregs = *regs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment