'topstk' is a misnomer: it is not a pointer to the top of a stack. Rather, it is
an argument passed to the main function executed by a new kernel thread.

Signed-off-by: Alex Dowad <[email protected]>
---
 arch/blackfin/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 4aa5545..81cdd5f 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -109,9 +109,12 @@ asmlinkage int bfin_clone(unsigned long clone_flags, 
unsigned long newsp)
        return do_fork(clone_flags, newsp, 0, NULL, NULL);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int
 copy_thread(unsigned long clone_flags,
-           unsigned long usp, unsigned long topstk,
+           unsigned long usp, unsigned long kthread_arg,
            struct task_struct *p)
 {
        struct pt_regs *childregs;
@@ -120,14 +123,16 @@ copy_thread(unsigned long clone_flags,
        childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1;
        v = ((unsigned long *)childregs) - 2;
        if (unlikely(p->flags & PF_KTHREAD)) {
+               /* kernel thread */
                memset(childregs, 0, sizeof(struct pt_regs));
                v[0] = usp;
-               v[1] = topstk;
+               v[1] = kthread_arg;
                childregs->orig_p0 = -1;
                childregs->ipend = 0x8000;
                __asm__ __volatile__("%0 = syscfg;":"=da"(childregs->syscfg):);
                p->thread.usp = 0;
        } else {
+               /* user thread */
                *childregs = *current_pt_regs();
                childregs->r0 = 0;
                p->thread.usp = usp ? : rdusp();
-- 
2.0.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to