summaryrefslogtreecommitdiffstats
path: root/arch/openrisc/kernel/entry.S
diff options
context:
space:
mode:
authorJonas Bonn <jonas@southpole.se>2012-10-19 18:07:44 +0200
committerJonas Bonn <jonas@southpole.se>2012-10-19 18:32:36 +0200
commitcbf23cf1b96819599f6a1b9658d1bf3a97c6ff15 (patch)
tree4ed2583ded570499617cc6fd9caffb4f17eddbd5 /arch/openrisc/kernel/entry.S
parent287ad220cd8b5a9d29f71c78f6e4051093f051fc (diff)
downloadop-kernel-dev-cbf23cf1b96819599f6a1b9658d1bf3a97c6ff15.zip
op-kernel-dev-cbf23cf1b96819599f6a1b9658d1bf3a97c6ff15.tar.gz
openrisc: use generic kernel_thread/kernel_execve
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc/kernel/entry.S')
-rw-r--r--arch/openrisc/kernel/entry.S30
1 files changed, 10 insertions, 20 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index 374e63e..dce86ae 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -894,6 +894,16 @@ ENTRY(ret_from_fork)
l.jal schedule_tail
l.nop
+ /* Check if we are a kernel thread */
+ l.sfeqi r20,0
+ l.bf 1f
+ l.nop
+
+ /* ...we are a kernel thread so invoke the requested callback */
+ l.jalr r20
+ l.or r3,r22,r0
+
+1:
/* _syscall_returns expect r11 to contain return value */
l.lwz r11,PT_GPR11(r1)
@@ -915,26 +925,6 @@ ENTRY(ret_from_fork)
l.j _syscall_return
l.nop
-/* Since syscalls don't save call-clobbered registers, the args to
- * kernel_thread_helper will need to be passed through callee-saved
- * registers and copied to the parameter registers when the thread
- * begins running.
- *
- * See arch/openrisc/kernel/process.c:
- * The args are passed as follows:
- * arg1 (r3) : passed in r20
- * arg2 (r4) : passed in r22
- */
-
-ENTRY(_kernel_thread_helper)
- l.or r3,r20,r0
- l.or r4,r22,r0
- l.movhi r31,hi(kernel_thread_helper)
- l.ori r31,r31,lo(kernel_thread_helper)
- l.jr r31
- l.nop
-
-
/* ========================================================[ switch ] === */
/*
OpenPOWER on IntegriCloud