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

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

commit 0a4982a80e73feb69f8c8f7e759d3f7c64b3fbff
Author: Abdelatif Guettouche <[email protected]>
AuthorDate: Fri Jun 25 15:07:23 2021 +0100

    Introduce ARCH_HAVE_EXTRA_HEAPS, this config is going to be used for
    chips that have multiple separate heaps.
    For now it's used to enable APIs to initialize the different heaps
    during the start sequence but can be extended for other purposes that
    manage those heaps.
    
    Signed-off-by: Abdelatif Guettouche <[email protected]>
---
 arch/Kconfig          | 12 ++++++++++--
 include/nuttx/arch.h  | 12 ++++++------
 sched/init/nx_start.c |  6 ++++--
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 5b11791..7d71aba 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -259,9 +259,17 @@ config ARCH_NEED_ADDRENV_MAPPING
        bool
        default n
 
+config ARCH_HAVE_EXTRA_HEAPS
+       bool
+       default n
+       ---help---
+               Special memory regions used as separate heaps
+
 config ARCH_HAVE_TEXT_HEAP
-       bool "Special memory region for dynamic code loading"
+       bool
        default n
+       ---help---
+               Special memory region for dynamic code loading
 
 config ARCH_HAVE_MULTICPU
        bool
@@ -372,7 +380,7 @@ config ARCH_USE_MPU
                selection will always be forced.
 
 config ARCH_USE_TEXT_HEAP
-       bool "Enable separate text heap for dynamic code loading"
+       bool "Enable separate text allocation for dynamic code loading"
        default n
        depends on ARCH_HAVE_TEXT_HEAP
        ---help---
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 391eb8c..517ec3f 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -754,22 +754,22 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages);
 #endif
 
 /****************************************************************************
- * Name: up_textheap_init
+ * Name: up_extraheaps_init
  *
  * Description:
- *   Initialize the text heap.
+ *   Initialize any extra heap.
  *
  ****************************************************************************/
 
-#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
-void up_textheap_init(void);
+#if defined(CONFIG_ARCH_HAVE_EXTRA_HEAPS)
+void up_extraheaps_init(void);
 #endif
 
 /****************************************************************************
  * Name: up_textheap_memalign
  *
  * Description:
- *   Allocate memory from the text heap with the specified alignment.
+ *   Allocate memory for text sections with the specified alignment.
  *
  ****************************************************************************/
 
@@ -781,7 +781,7 @@ FAR void *up_textheap_memalign(size_t align, size_t size);
  * Name: up_textheap_free
  *
  * Description:
- *   Free memory from the text heap.
+ *   Free memory allocated for text sections.
  *
  ****************************************************************************/
 
diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c
index d6b86f4..6361695 100644
--- a/sched/init/nx_start.c
+++ b/sched/init/nx_start.c
@@ -572,8 +572,10 @@ void nx_start(void)
     }
 #endif
 
-#ifdef CONFIG_ARCH_USE_TEXT_HEAP
-  up_textheap_init();
+#ifdef CONFIG_ARCH_HAVE_EXTRA_HEAPS
+  /* Initialize any extra heap. */
+
+  up_extraheaps_init();
 #endif
 
 #ifdef CONFIG_MM_IOB

Reply via email to