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/06/16 12:48:45 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #1009: Add support for preemptive scheduling in simulator build

xiaoxiang781216 commented on a change in pull request #1009:
URL: https://github.com/apache/incubator-nuttx/pull/1009#discussion_r440822441



##########
File path: arch/sim/include/irq.h
##########
@@ -44,6 +44,10 @@
  * Included Files
  ****************************************************************************/
 
+#ifdef CONFIG_SIM_PREEMPTIBLE
+#  include <ucontext.h>

Review comment:
       Two methods I can imagine:
   1.Call malloc/free function on host side just like you call host timer API
   2.Define an array of sigjmp_buf like this:
   ```
     sigjmp_buf g_jmpbuf[CONFIG_MAX_TASKS];
   ```
   and access it through pid:
   ```
   g_jmpbuf[PIDHASH(pid))]
   ```
   BTW, you don't need save pointer inside xcpcontext.




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