You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/07/01 13:32:14 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1341: Call c++ global variables in nxtask_startup

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:
users@infra.apache.org