[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1351179999-8376-2-git-send-email-jonas@southpole.se>
Date: Thu, 25 Oct 2012 17:46:38 +0200
From: Jonas Bonn <jonas@...thpole.se>
To: viro@...iv.linux.org.uk
Cc: linux-kernel@...r.kernel.org, Jonas Bonn <jonas@...thpole.se>
Subject: [PATCH 1/2] openrisc: move sys_clone's stack determination to copy_thread
Signed-off-by: Jonas Bonn <jonas@...thpole.se>
---
arch/openrisc/kernel/process.c | 6 +++++-
arch/openrisc/kernel/sys_or32.c | 8 +-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index e0874b8..efbe4f8 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -170,7 +170,11 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
} else {
*userregs = *regs;
- userregs->sp = usp;
+ if (usp)
+ userregs->sp = usp; /* clone */
+ else
+ userregs->sp = regs->sp; /* fork/clone */
+
userregs->gpr[11] = 0; /* Result from fork() */
kregs->gpr[20] = 0; /* Userspace thread */
diff --git a/arch/openrisc/kernel/sys_or32.c b/arch/openrisc/kernel/sys_or32.c
index d6ddd3c..db46b82 100644
--- a/arch/openrisc/kernel/sys_or32.c
+++ b/arch/openrisc/kernel/sys_or32.c
@@ -46,12 +46,6 @@ asmlinkage long _sys_clone(unsigned long clone_flags, unsigned long newsp,
{
long ret;
- /* FIXME: Is alignment necessary? */
- /* newsp = ALIGN(newsp, 4); */
-
- if (!newsp)
- newsp = regs->sp;
-
ret = do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
return ret;
@@ -60,7 +54,7 @@ asmlinkage long _sys_clone(unsigned long clone_flags, unsigned long newsp,
asmlinkage int _sys_fork(struct pt_regs *regs)
{
#ifdef CONFIG_MMU
- return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
+ return do_fork(SIGCHLD, 0, regs, 0, NULL, NULL);
#else
return -EINVAL;
#endif
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists