Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sched: nxtask_start should call entry point directly for kernel thread #1922

Merged
merged 1 commit into from
Oct 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions sched/task/task_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,18 @@ void nxtask_start(void)
* we have to switch to user-mode before calling the task.
*/

#ifndef CONFIG_BUILD_FLAT
if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL)
{
up_task_start(tcb->cmn.entry.main, argc, tcb->argv);
exitcode = tcb->cmn.entry.main(argc, tcb->argv);
}
else
{
exitcode = tcb->cmn.entry.main(argc, tcb->argv);
}
#ifdef CONFIG_BUILD_FLAT
nxtask_startup(tcb->cmn.entry.main, argc, tcb->argv);
#else
nxtask_startup(tcb->cmn.entry.main, argc, tcb->argv);
up_task_start(tcb->cmn.entry.main, argc, tcb->argv);
#endif
}

/* Call exit() if/when the task returns */

Expand Down