summaryrefslogtreecommitdiff
path: root/arch/openrisc/kernel/entry.S
diff options
context:
space:
mode:
authorJonas Bonn <jonas@southpole.se>2012-10-14 16:19:52 +0200
committerJonas Bonn <jonas@southpole.se>2012-10-19 18:32:36 +0200
commit287ad220cd8b5a9d29f71c78f6e4051093f051fc (patch)
treedc04df7d8474f1f9a5fb597423f955595ba24a0d /arch/openrisc/kernel/entry.S
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
openrisc: pass correct arg to schedule_tail
schedule_tail() requires that the 'prev' task be passed as an argument to it. This arg is set in _switch, just before 'returning' to one of the ret_* functions where schedule_tail is invoked. Signed-off-by: Jonas Bonn <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc/kernel/entry.S')
-rw-r--r--arch/openrisc/kernel/entry.S9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index ddfcaa828b0e..374e63e7c9f6 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -1044,8 +1044,13 @@ ENTRY(_switch)
/* Unwind stack to pre-switch state */
l.addi r1,r1,(INT_FRAME_SIZE)
- /* Return via the link-register back to where we 'came from', where that can be
- * either schedule() or return_from_fork()... */
+ /* Return via the link-register back to where we 'came from', where
+ * that may be either schedule(), ret_from_fork(), or
+ * ret_from_kernel_thread(). If we are returning to a new thread,
+ * we are expected to have set up the arg to schedule_tail already,
+ * hence we do so here unconditionally:
+ */
+ l.lwz r3,TI_STACK(r3) /* Load 'prev' as schedule_tail arg */
l.jr r9
l.nop