lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 25/32] score: copy_thread(): rename 'arg' argument to 'kthread_arg'
Date
The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity (and consistency
with do_fork() and other arch-specific implementations of copy_thread()).

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---
arch/score/kernel/process.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
index a1519ad3..a72d15f 100644
--- a/arch/score/kernel/process.c
+++ b/arch/score/kernel/process.c
@@ -66,10 +66,10 @@ void exit_thread(void) {}
void flush_thread(void) {}

/*
- * set up the kernel stack and exception frames for a new process
+ * Copy architecture-specific thread state
*/
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 thread_info *ti = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
@@ -77,11 +77,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,

p->thread.reg0 = (unsigned long) childregs;
if (unlikely(p->flags & PF_KTHREAD)) {
+ /* kernel thread */
memset(childregs, 0, sizeof(struct pt_regs));
p->thread.reg12 = usp;
- p->thread.reg13 = arg;
+ p->thread.reg13 = kthread_arg;
p->thread.reg3 = (unsigned long) ret_from_kernel_thread;
} else {
+ /* user thread */
*childregs = *current_pt_regs();
childregs->regs[7] = 0; /* Clear error flag */
childregs->regs[4] = 0; /* Child gets zero as return value */
--
2.0.0.GIT


\
 
 \ /
  Last update: 2015-03-13 19:41    [W:0.197 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site