You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/03/25 08:47:58 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8885: Increase the number of real time signals. Two is not enough.

xiaoxiang781216 commented on code in PR #8885:
URL: https://github.com/apache/nuttx/pull/8885#discussion_r1148330750


##########
include/nuttx/signal.h:
##########
@@ -191,6 +204,99 @@ int nxsig_addset(FAR sigset_t *set, int signo);
 
 int nxsig_delset(FAR sigset_t *set, int signo);
 
+/****************************************************************************
+ * Name: nxsig_addmultiple
+ *
+ * Description:
+ *   This function adds multiple signals specified by addset to the signal
+ *   set specified by source.  The result is returned in dest.
+ *
+ * Input Parameters:
+ *   dest   - The location to return the result
+ *   source - Signal set to add signal to
+ *   addset - Signals to add
+ *
+ * Returned Value:
+ *   This is an internal OS interface and should not be used by applications.
+ *   It follows the NuttX internal error return policy:  Zero (OK) is
+ *   returned on success.  A negated errno value is returned on failure.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+int nxsig_addmultiple(FAR sigset_t *dest, FAR const sigset_t *source,

Review Comment:
   same as sigorset



##########
include/nuttx/signal.h:
##########
@@ -44,6 +44,19 @@
   #define sigwork_init(work) (void)(work)
 #endif
 
+/* Internal signal set definitions */
+
+#define _NO_SIGNALS     ((uint32_t)0x00000000)
+#define _ALL_SIGNALS    ((uint32_t)0xffffffff)
+#define _SIGSET_NDX(s)  ((s) >> 5)    /* Get array index from signal number */
+#define _SIGSET_BIT(s)  ((s) & 0x1f)  /* Get bit number from signal number */
+#define _SIGNO2SET(s)   ((uint32_t)1 << _SIGSET_BIT(s))
+
+/* Helper macros for printing signal sets. */
+
+#define SIGSET_FMT     "%08" PRIx32 "%08" PRIx32

Review Comment:
   move to https://github.com/apache/nuttx/pull/8885/files#diff-944d6d12b7cba69e3ea374135ebc541fd819308865868374776e7dc79d627195R57-R60



##########
include/signal.h:
##########
@@ -497,13 +506,16 @@ int  raise(int signo);
 int  sigaction(int signo, FAR const struct sigaction *act,
                FAR struct sigaction *oact);
 int  sigaddset(FAR sigset_t *set, int signo);
+int  sigandset(FAR sigset_t *dest, FAR sigset_t *left, FAR sigset_t *right);

Review Comment:
   should we move the new api to nuttx/signal.h and add nx



##########
include/nuttx/signal.h:
##########
@@ -44,6 +44,19 @@
   #define sigwork_init(work) (void)(work)
 #endif
 
+/* Internal signal set definitions */
+
+#define _NO_SIGNALS     ((uint32_t)0x00000000)
+#define _ALL_SIGNALS    ((uint32_t)0xffffffff)
+#define _SIGSET_NDX(s)  ((s) >> 5)    /* Get array index from signal number */
+#define _SIGSET_BIT(s)  ((s) & 0x1f)  /* Get bit number from signal number */
+#define _SIGNO2SET(s)   ((uint32_t)1 << _SIGSET_BIT(s))

Review Comment:
   dup with:
   https://github.com/apache/nuttx/pull/8885/files#diff-944d6d12b7cba69e3ea374135ebc541fd819308865868374776e7dc79d627195R57-R60



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org