mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: viro@zeniv.linux.org.uk
Cc: linux-kernel@vger.kernel.org, Jonas Bonn <jonas@southpole.se>
Subject: [PATCH 2/2] openrisc: determine regs directly in copy_thread
Date: Thu, 25 Oct 2012 17:46:39 +0200	[thread overview]
Message-ID: <1351179999-8376-3-git-send-email-jonas@southpole.se> (raw)
In-Reply-To: <1351179999-8376-1-git-send-email-jonas@southpole.se>

copy_thread can use current_pt_regs() to get the pt_regs data that
it needs so there's no need to pass this in as an argument.

As do_fork() doesn't use the regs argument for anything other than
to pass it straight through to copy_thread, we just pass in a NULL
argument in its place.  The plan seems to be to eventually drop the
regs argument to do_fork altogether.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
 arch/openrisc/kernel/entry.S    |    6 ++----
 arch/openrisc/kernel/process.c  |    3 ++-
 arch/openrisc/kernel/sys_or32.c |    9 ++++-----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index cbd8f13..ea5439e 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -1073,15 +1073,13 @@ _fork_save_extra_regs_and_call:
 
 ENTRY(sys_clone)
 	l.movhi	r29,hi(_sys_clone)
-	l.ori	r29,r29,lo(_sys_clone)
 	l.j	_fork_save_extra_regs_and_call
-	 l.addi	r7,r1,0
+	 l.ori	r29,r29,lo(_sys_clone)
 
 ENTRY(sys_fork)
 	l.movhi	r29,hi(_sys_fork)
-	l.ori	r29,r29,lo(_sys_fork)
 	l.j	_fork_save_extra_regs_and_call
-	 l.addi	r3,r1,0
+	 l.ori	r29,r29,lo(_sys_fork)
 
 ENTRY(sys_vfork)
 	l.movhi	r29,hi(_sys_vfork)
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index efbe4f8..87ca585 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -142,8 +142,9 @@ extern asmlinkage 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 *regs)
+	    unsigned long arg, struct task_struct *p, struct pt_regs * unused)
 {
+	struct pt_regs *regs = current_pt_regs();
 	struct pt_regs *userregs;
 	struct pt_regs *kregs;
 	unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
diff --git a/arch/openrisc/kernel/sys_or32.c b/arch/openrisc/kernel/sys_or32.c
index db46b82..a50826d 100644
--- a/arch/openrisc/kernel/sys_or32.c
+++ b/arch/openrisc/kernel/sys_or32.c
@@ -41,20 +41,19 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
  */
 
 asmlinkage long _sys_clone(unsigned long clone_flags, unsigned long newsp,
-			   int __user *parent_tid, int __user *child_tid,
-			   struct pt_regs *regs)
+			   int __user *parent_tid, int __user *child_tid)
 {
 	long ret;
 
-	ret = do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
+	ret = do_fork(clone_flags, newsp, 0, 0, parent_tid, child_tid);
 
 	return ret;
 }
 
-asmlinkage int _sys_fork(struct pt_regs *regs)
+asmlinkage int _sys_fork()
 {
 #ifdef CONFIG_MMU
-	return do_fork(SIGCHLD, 0, regs, 0, NULL, NULL);
+	return do_fork(SIGCHLD, 0, 0, 0, NULL, NULL);
 #else
 	return -EINVAL;
 #endif
-- 
1.7.9.5


  parent reply	other threads:[~2012-10-25 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 15:46 [PATCH 0/2] openrisc: more kernel_thread cleanup Jonas Bonn
2012-10-25 15:46 ` [PATCH 1/2] openrisc: move sys_clone's stack determination to copy_thread Jonas Bonn
2012-10-25 15:55   ` Al Viro
2012-10-25 16:16     ` Jonas Bonn
2012-10-25 15:46 ` Jonas Bonn [this message]
2012-10-25 16:27   ` [PATCH 2/2] openrisc: determine regs directly in copy_thread Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351179999-8376-3-git-send-email-jonas@southpole.se \
    --to=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®