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


##########
sched/mqueue/mq_notify.c:
##########
@@ -156,6 +160,29 @@ int mq_notify(mqd_t mqdes, FAR const struct sigevent 
*notification)
                  sizeof(struct sigevent));
 
           msgq->ntpid = rtcb->pid;
+
+#if defined(CONFIG_FDPIC) && defined(CONFIG_SIG_EVTHREAD)
+          /* Resolve the callback here, where this still runs in the
+           * module's context.  It fires later on a worker that carries no
+           * data base, so the base travels with it.  The descriptor holds
+           * the base of the module the callback belongs to, which is not
+           * always the caller's.  The function shares a union with the
+           * thread ID, so only a SIGEV_THREAD event has one to resolve.
+           */
+
+          msgq->ntwork.desc.got = 0;
+
+          if ((notification->sigev_notify & SIGEV_THREAD) != 0 &&

Review Comment:
   Done



##########
include/nuttx/fdpic.h:
##########
@@ -100,29 +100,32 @@ static inline FAR void *fdpic_callback(FAR void *fn)
  * Name: fdpic_invoke
  *
  * Description:
- *   Call a resolved module entry point with the module data base in the PIC
- *   base register.  For a callback that runs on a shared thread, which
- *   carries no module base.  Elsewhere fdpic_callback() is enough.
+ *   Call a function pointer as it was received, with the data base it names
+ *   in the PIC base register.  For a callback that runs on a shared thread,
+ *   which carries no module base.  Elsewhere fdpic_callback() is enough.
+ *
+ *   A function pointer is the address of a descriptor, so the entry point
+ *   and the data base both come from it.
  *
  * Input Parameters:
- *   arg   - The one word argument.
- *   entry - The code address to enter, already resolved from the descriptor.
- *   got   - The module data base to install.
+ *   arg - The one word argument.
+ *   fn  - The callback, as the caller received it.
  *
  ****************************************************************************/
 
-static inline void fdpic_invoke(uintptr_t arg, uintptr_t entry,
-                                uintptr_t got)
+static inline void fdpic_invoke(uintptr_t arg, FAR void *fn)

Review Comment:
   Done



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