You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/12/20 18:32:07 UTC

[incubator-nuttx] branch master updated (9ea229c -> deef880)

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 9ea229c  boards: Remove CINCPATH and CXXINCPATH
     new c079760  sched/mqueue: Make the pre-allocated irq messages configurable
     new deef880  sched/signal: Make the pre-allocated irq actions configurable

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 sched/Kconfig                 | 12 ++++++++++++
 sched/mqueue/mq_initialize.c  |  2 +-
 sched/mqueue/mqueue.h         |  6 ------
 sched/signal/sig_initialize.c |  4 ++--
 sched/signal/signal.h         |  2 --
 5 files changed, 15 insertions(+), 11 deletions(-)


[incubator-nuttx] 01/02: sched/mqueue: Make the pre-allocated irq messages configurable

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c07976077731e6da417b204ab8b01f9674e12fa7
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Dec 14 15:42:22 2020 +0800

    sched/mqueue: Make the pre-allocated irq messages configurable
    
    the message can't be dynamically allocated in any irq handler
    so it's important to let the user extend the number as needed
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: Ia26584c3815bac6cf24de4c88be0844ac8e8fba2
---
 sched/Kconfig                | 6 ++++++
 sched/mqueue/mq_initialize.c | 2 +-
 sched/mqueue/mqueue.h        | 6 ------
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sched/Kconfig b/sched/Kconfig
index 591e186..2a41d1c 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -1536,6 +1536,12 @@ config PREALLOC_MQ_MSGS
 		The number of pre-allocated message structures.  The system manages
 		a pool of preallocated message structures to minimize dynamic allocations
 
+config PREALLOC_MQ_IRQ_MSGS
+	int "Number of pre-allocated irq messages"
+	default 8
+	---help---
+		The number of pre-allocated irq message structures.
+
 config MQ_MAXMSGSIZE
 	int "Maximum message size"
 	default 32
diff --git a/sched/mqueue/mq_initialize.c b/sched/mqueue/mq_initialize.c
index 2cf9a78..aefd74b 100644
--- a/sched/mqueue/mq_initialize.c
+++ b/sched/mqueue/mq_initialize.c
@@ -168,7 +168,7 @@ void nxmq_initialize(void)
    */
 
   g_msgfreeirqalloc =
-    mq_msgblockalloc(&g_msgfreeirq, NUM_INTERRUPT_MSGS,
+    mq_msgblockalloc(&g_msgfreeirq, CONFIG_PREALLOC_MQ_IRQ_MSGS,
                      MQ_ALLOC_IRQ);
 
   /* Allocate a block of message queue descriptors */
diff --git a/sched/mqueue/mqueue.h b/sched/mqueue/mqueue.h
index 39e4080..0c1b78a 100644
--- a/sched/mqueue/mqueue.h
+++ b/sched/mqueue/mqueue.h
@@ -53,12 +53,6 @@
 
 #define NUM_MSG_DESCRIPTORS  4
 
-/* This defines the number of messages to set aside for exclusive use by
- * interrupt handlers
- */
-
-#define NUM_INTERRUPT_MSGS   8
-
 /********************************************************************************
  * Public Type Definitions
  ********************************************************************************/


[incubator-nuttx] 02/02: sched/signal: Make the pre-allocated irq actions configurable

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit deef880daee83ad2fa1511539d7117c0be71496c
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Dec 14 17:33:38 2020 +0800

    sched/signal: Make the pre-allocated irq actions configurable
    
    the action can't be dynamically allocated in any irq handler
    so it's important to let the user extend the number as needed
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: Id30c5d93003e63514c24f2ca0df2f634c4c63c5f
---
 sched/Kconfig                 | 6 ++++++
 sched/signal/sig_initialize.c | 4 ++--
 sched/signal/signal.h         | 2 --
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/sched/Kconfig b/sched/Kconfig
index 2a41d1c..a112330 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -1309,6 +1309,12 @@ endmenu # RTOS hooks
 
 menu "Signal Configuration"
 
+config SIG_PREALLOC_IRQ_ACTIONS
+	int "Number of pre-allocated irq actions"
+	default 8
+	---help---
+		The number of pre-allocated irq action structures.
+
 config SIG_EVTHREAD
 	bool "Support SIGEV_THHREAD"
 	default n
diff --git a/sched/signal/sig_initialize.c b/sched/signal/sig_initialize.c
index 0a03ff2..39f4ca1 100644
--- a/sched/signal/sig_initialize.c
+++ b/sched/signal/sig_initialize.c
@@ -230,7 +230,7 @@ void nxsig_initialize(void)
 
   g_sigpendingirqactionalloc =
     nxsig_alloc_block(&g_sigpendingirqaction,
-                      NUM_PENDING_INT_ACTIONS,
+                      CONFIG_SIG_PREALLOC_IRQ_ACTIONS,
                       SIG_ALLOC_IRQ);
   DEBUGASSERT(g_sigpendingirqactionalloc != NULL);
 
@@ -242,7 +242,7 @@ void nxsig_initialize(void)
 
   g_sigpendingirqsignalalloc =
     nxsig_alloc_pendingsignalblock(&g_sigpendingirqsignal,
-                                   NUM_INT_SIGNALS_PENDING,
+                                   CONFIG_SIG_PREALLOC_IRQ_ACTIONS,
                                    SIG_ALLOC_IRQ);
   DEBUGASSERT(g_sigpendingirqsignalalloc != NULL);
 }
diff --git a/sched/signal/signal.h b/sched/signal/signal.h
index e8d36d0..5689fe2 100644
--- a/sched/signal/signal.h
+++ b/sched/signal/signal.h
@@ -60,9 +60,7 @@
 
 #define NUM_SIGNAL_ACTIONS       4
 #define NUM_PENDING_ACTIONS      4
-#define NUM_PENDING_INT_ACTIONS  8
 #define NUM_SIGNALS_PENDING      4
-#define NUM_INT_SIGNALS_PENDING  8
 
 /****************************************************************************
  * Public Type Definitions