diff options
author | Jonas Bonn <jonas@southpole.se> | 2012-10-14 10:19:52 -0400 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2012-10-19 12:32:36 -0400 |
commit | 287ad220cd8b5a9d29f71c78f6e4051093f051fc (patch) | |
tree | dc04df7d8474f1f9a5fb597423f955595ba24a0d /arch/openrisc/kernel | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (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')
-rw-r--r-- | arch/openrisc/kernel/entry.S | 9 | ||||
-rw-r--r-- | arch/openrisc/kernel/process.c | 1 |
2 files changed, 7 insertions, 3 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) | |||
1044 | /* Unwind stack to pre-switch state */ | 1044 | /* Unwind stack to pre-switch state */ |
1045 | l.addi r1,r1,(INT_FRAME_SIZE) | 1045 | l.addi r1,r1,(INT_FRAME_SIZE) |
1046 | 1046 | ||
1047 | /* Return via the link-register back to where we 'came from', where that can be | 1047 | /* Return via the link-register back to where we 'came from', where |
1048 | * either schedule() or return_from_fork()... */ | 1048 | * that may be either schedule(), ret_from_fork(), or |
1049 | * ret_from_kernel_thread(). If we are returning to a new thread, | ||
1050 | * we are expected to have set up the arg to schedule_tail already, | ||
1051 | * hence we do so here unconditionally: | ||
1052 | */ | ||
1053 | l.lwz r3,TI_STACK(r3) /* Load 'prev' as schedule_tail arg */ | ||
1049 | l.jr r9 | 1054 | l.jr r9 |
1050 | l.nop | 1055 | l.nop |
1051 | 1056 | ||
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index c35f3ab1a8d3..ad26d5af2649 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c | |||
@@ -165,7 +165,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp, | |||
165 | * the kernel stack. | 165 | * the kernel stack. |
166 | */ | 166 | */ |
167 | kregs->sp = top_of_kernel_stack; | 167 | kregs->sp = top_of_kernel_stack; |
168 | kregs->gpr[3] = (unsigned long)current; /* arg to schedule_tail */ | ||
169 | kregs->gpr[10] = (unsigned long)task_thread_info(p); | 168 | kregs->gpr[10] = (unsigned long)task_thread_info(p); |
170 | kregs->gpr[9] = (unsigned long)ret_from_fork; | 169 | kregs->gpr[9] = (unsigned long)ret_from_fork; |
171 | 170 | ||