Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 287ad220 authored by Jonas Bonn's avatar Jonas Bonn
Browse files

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: default avatarJonas Bonn <jonas@southpole.se>
parent ddffeb8c
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -1044,8 +1044,13 @@ ENTRY(_switch)
	/* Unwind stack to pre-switch state */
	/* Unwind stack to pre-switch state */
	l.addi  r1,r1,(INT_FRAME_SIZE)
	l.addi  r1,r1,(INT_FRAME_SIZE)


	/* Return via the link-register back to where we 'came from', where that can be
	/* Return via the link-register back to where we 'came from', where
	 * either schedule() or return_from_fork()... */
	 * 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.jr	r9
	 l.nop
	 l.nop


+0 −1
Original line number Original line Diff line number Diff line
@@ -165,7 +165,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
	 * the kernel stack.
	 * the kernel stack.
	 */
	 */
	kregs->sp = top_of_kernel_stack;
	kregs->sp = top_of_kernel_stack;
	kregs->gpr[3] = (unsigned long)current;	/* arg to schedule_tail */
	kregs->gpr[10] = (unsigned long)task_thread_info(p);
	kregs->gpr[10] = (unsigned long)task_thread_info(p);
	kregs->gpr[9] = (unsigned long)ret_from_fork;
	kregs->gpr[9] = (unsigned long)ret_from_fork;