patacongo commented on a change in pull request #1341:
URL: https://github.com/apache/incubator-nuttx/pull/1341#discussion_r448365342
##########
File path: sched/task/task_start.c
##########
@@ -138,13 +138,14 @@ void nxtask_start(void)
if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
{
up_task_start(tcb->cmn.entry.main, argc, tcb->argv);
- exitcode = EXIT_FAILURE; /* Should not get here */
}
else
-#endif
{
exitcode = tcb->cmn.entry.main(argc, tcb->argv);
}
+#else
+ nxtask_startup(tcb->cmn.entry.main, argc, tcb->argv);
Review comment:
Here nxtask_startup() is called in kernel mode. That is wrong. This
cannot be merged. You removed the call to up_start_task() for the PROTECTED
mode, that is what switched user mode BEFORE callint nxtask_start(). As you
have it here, the task will run in supervisor mode with is very wrong.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]