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/08/22 13:08:29 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1602: arch/sim: Add support for preemptive scheduling in the simulator build using ucontext API

patacongo commented on a change in pull request #1602:
URL: https://github.com/apache/incubator-nuttx/pull/1602#discussion_r475088753



##########
File path: sched/task/task_setup.c
##########
@@ -593,6 +598,11 @@ static inline int nxtask_setup_stackargs(FAR struct task_tcb_s *tcb,
   stackargv[argc + 1] = NULL;
   tcb->argv = stackargv;
 
+#ifdef CONFIG_SIM_PREEMPTIBLE
+  up_setup_args_context(tcb->cmn.xcp.ucontext_buffer, tcb->cmn.start, argc,

Review comment:
       > 
   > 
   > it isn't good to modify the common code for the arch specific need.
   
   Let me emphasize how important this is.  There are modularity rules to keep NuttX from degrading into spaghetti code.  This violates the core principle of the modular design.  There must be NO sim-specific logic outside of the arch/srm and boards/sim "silos"  (see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629399).  The common OS MUST be completely independent of all architectures.
   
   Can you imagine what a mess it would be if everyone put platform-specific code throughout of the OS.  It would be a miserable mess.  We need to absolutely prohibit any violations of the modular architecture to keep it from falling into spaghetti code hell.
   




----------------------------------------------------------------
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