casaroli commented on code in PR #20130:
URL: https://github.com/apache/nuttx/pull/20130#discussion_r4012941256


##########
sched/task/task_create.c:
##########
@@ -202,8 +206,18 @@ int task_create_with_stack(FAR const char *name, int 
priority,
                            FAR void *stack_addr, int stack_size,
                            main_t entry, FAR char * const argv[])
 {
-  int ret = nxtask_create(name, priority, stack_addr,
-                          stack_size, entry, argv, NULL);
+  int ret;
+
+#ifdef CONFIG_FDPIC
+  /* Resolve here, once: this covers task_create() too, which is a plain
+   * forwarder.  The new task inherits the creator's D-Space.
+   */
+
+  entry = (main_t)fdpic_callback((FAR void *)entry);

Review Comment:
   the new task already gets r9 from the inherited dspace 
(`nxtask_dup_dspace()` -> `up_initial_state()` -> `REG_PIC`) and keeps it for 
its life, so only the entry needs unwrapping; `fdpic_invoke()` is for a 
callback on a shared worker, which has no base.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to