You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/06/18 12:14:24 UTC
[incubator-nuttx] branch master updated: Rename MODULE_TEXT to
TEXT_HEAP as the latter is more generic.
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
The following commit(s) were added to refs/heads/master by this push:
new af5e0c6 Rename MODULE_TEXT to TEXT_HEAP as the latter is more generic.
af5e0c6 is described below
commit af5e0c620fabac4736c9658041dde6807eb15203
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Fri Jun 18 00:47:45 2021 +0100
Rename MODULE_TEXT to TEXT_HEAP as the latter is more generic.
Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
arch/Kconfig | 10 +++---
arch/arm/Kconfig | 2 +-
arch/arm/src/cxd56xx/Kconfig | 2 +-
arch/arm/src/cxd56xx/Make.defs | 4 +--
.../cxd56xx/{cxd56_modtext.c => cxd56_textheap.c} | 14 ++++----
arch/risc-v/Kconfig | 2 +-
arch/risc-v/src/esp32c3/Make.defs | 4 +--
.../{esp32c3_modtext.c => esp32c3_textheap.c} | 14 ++++----
arch/sim/src/sim/up_heap.c | 2 +-
arch/xtensa/Kconfig | 4 +--
arch/xtensa/src/esp32/Make.defs | 4 +--
.../esp32/{esp32_modtext.c => esp32_textheap.c} | 42 +++++++++++-----------
arch/xtensa/src/esp32/esp32_user.c | 14 ++++----
arch/xtensa/src/esp32s2/Make.defs | 5 ---
arch/xtensa/src/esp32s2/esp32s2_user.c | 14 ++++----
binfmt/binfmt_unloadmodule.c | 4 +--
binfmt/libelf/libelf_addrenv.c | 12 +++----
.../esp32c3/esp32c3-devkit/configs/elf/defconfig | 2 +-
.../esp32/esp32-devkitc/configs/elf/defconfig | 2 +-
.../esp32/esp32-devkitc/scripts/esp32.template.ld | 4 +--
.../esp32/esp32-devkitc/scripts/esp32_flash.ld | 4 +--
.../esp32/esp32-devkitc/scripts/esp32_iram.ld | 4 +--
.../esp32-ethernet-kit/scripts/esp32.template.ld | 4 +--
.../esp32-ethernet-kit/scripts/esp32_flash.ld | 4 +--
.../esp32/esp32-ethernet-kit/scripts/esp32_iram.ld | 4 +--
.../esp32-wrover-kit/scripts/esp32.template.ld | 4 +--
.../esp32/esp32-wrover-kit/scripts/esp32_flash.ld | 4 +--
.../esp32/esp32-wrover-kit/scripts/esp32_iram.ld | 4 +--
include/nuttx/arch.h | 24 ++++++-------
include/nuttx/binfmt/elf.h | 2 +-
libs/libc/modlib/Kconfig | 2 +-
libs/libc/modlib/modlib_load.c | 6 ++--
libs/libc/modlib/modlib_unload.c | 4 +--
sched/Kconfig | 2 +-
sched/init/nx_start.c | 4 +--
sched/module/mod_rmmod.c | 4 +--
36 files changed, 118 insertions(+), 123 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index ac10cd2..5b11791 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -259,7 +259,7 @@ config ARCH_NEED_ADDRENV_MAPPING
bool
default n
-config ARCH_HAVE_MODULE_TEXT
+config ARCH_HAVE_TEXT_HEAP
bool "Special memory region for dynamic code loading"
default n
@@ -371,12 +371,12 @@ config ARCH_USE_MPU
is enabled by other, platform-specific logic. In those cases, this
selection will always be forced.
-config ARCH_USE_MODULE_TEXT
- bool "Enable module text allocator"
+config ARCH_USE_TEXT_HEAP
+ bool "Enable separate text heap for dynamic code loading"
default n
- depends on ARCH_HAVE_MODULE_TEXT
+ depends on ARCH_HAVE_TEXT_HEAP
---help---
- This option enable architecture-sepecific memory allocator
+ This option enables architecture-sepecific memory allocator
for dynamic code loading. For example, ESP32 has a separate memory
regions for instruction and data and the memory region used for
usual malloc doesn't work for instruction.
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 24eb010..c0c3086 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -456,7 +456,7 @@ config ARCH_CHIP_CXD56XX
select ARCH_HAVE_FPU
select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_MULTICPU
- select ARCH_HAVE_MODULE_TEXT
+ select ARCH_HAVE_TEXT_HEAP
select ARCH_HAVE_SDIO if MMCSD
select ARCH_HAVE_MATH_H
---help---
diff --git a/arch/arm/src/cxd56xx/Kconfig b/arch/arm/src/cxd56xx/Kconfig
index 0b50a4e..58c58cc 100644
--- a/arch/arm/src/cxd56xx/Kconfig
+++ b/arch/arm/src/cxd56xx/Kconfig
@@ -1344,7 +1344,7 @@ endif
config CXD56_USE_SYSBUS
bool "Use the system bus for the data section"
default y
- select ARCH_USE_MODULE_TEXT if ELF
+ select ARCH_USE_TEXT_HEAP if ELF
---help---
To make ldrex/strex work correctly, this option must be enabled
endmenu
diff --git a/arch/arm/src/cxd56xx/Make.defs b/arch/arm/src/cxd56xx/Make.defs
index cee7537..ab4119e 100644
--- a/arch/arm/src/cxd56xx/Make.defs
+++ b/arch/arm/src/cxd56xx/Make.defs
@@ -97,8 +97,8 @@ CHIP_CSRCS += cxd56_testset.c
endif
endif
-ifeq ($(CONFIG_ARCH_USE_MODULE_TEXT), y)
-CHIP_CSRCS += cxd56_modtext.c
+ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP), y)
+CHIP_CSRCS += cxd56_textheap.c
endif
ifeq ($(CONFIG_CXD56_UART0),y)
diff --git a/arch/arm/src/cxd56xx/cxd56_modtext.c b/arch/arm/src/cxd56xx/cxd56_textheap.c
similarity index 91%
rename from arch/arm/src/cxd56xx/cxd56_modtext.c
rename to arch/arm/src/cxd56xx/cxd56_textheap.c
index f17faba..3c5c04c 100644
--- a/arch/arm/src/cxd56xx/cxd56_modtext.c
+++ b/arch/arm/src/cxd56xx/cxd56_textheap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * arch/arm/src/cxd56xx/cxd56_modtext.c
+ * arch/arm/src/cxd56xx/cxd56_textheap.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -44,18 +44,18 @@
****************************************************************************/
/****************************************************************************
- * Name: up_module_text_init()
+ * Name: up_textheap_init()
****************************************************************************/
-void up_module_text_init()
+void up_textheap_init()
{
}
/****************************************************************************
- * Name: up_module_text_memalign()
+ * Name: up_textheap_memalign()
****************************************************************************/
-FAR void *up_module_text_memalign(size_t align, size_t size)
+FAR void *up_textheap_memalign(size_t align, size_t size)
{
FAR void *ret;
ret = (FAR void *)kmm_malloc(size);
@@ -80,10 +80,10 @@ FAR void *up_module_text_memalign(size_t align, size_t size)
}
/****************************************************************************
- * Name: up_module_text_free()
+ * Name: up_textheap_free()
****************************************************************************/
-void up_module_text_free(FAR void *p)
+void up_textheap_free(FAR void *p)
{
#ifdef CONFIG_CXD56_USE_SYSBUS
if (p)
diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig
index 78a333b..9d2281d 100644
--- a/arch/risc-v/Kconfig
+++ b/arch/risc-v/Kconfig
@@ -50,7 +50,7 @@ config ARCH_CHIP_ESP32C3
select LIBC_ARCH_MEMCCMP
select LIBC_ARCH_MEMMOVE
select LIBC_ARCH_MEMSET
- select ARCH_HAVE_MODULE_TEXT
+ select ARCH_HAVE_TEXT_HEAP
---help---
Espressif ESP32-C3 (RV32IMC).
diff --git a/arch/risc-v/src/esp32c3/Make.defs b/arch/risc-v/src/esp32c3/Make.defs
index 20b6aa7..7a47f31 100644
--- a/arch/risc-v/src/esp32c3/Make.defs
+++ b/arch/risc-v/src/esp32c3/Make.defs
@@ -156,8 +156,8 @@ CHIP_CSRCS += esp32c3_efuse_table.c
CHIP_CSRCS += esp32c3_efuse_lowerhalf.c
endif
-ifeq ($(CONFIG_ARCH_USE_MODULE_TEXT),y)
-CHIP_CSRCS += esp32c3_modtext.c
+ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP),y)
+CHIP_CSRCS += esp32c3_textheap.c
endif
ifeq ($(CONFIG_RTC_DRIVER),y)
diff --git a/arch/risc-v/src/esp32c3/esp32c3_modtext.c b/arch/risc-v/src/esp32c3/esp32c3_textheap.c
similarity index 92%
rename from arch/risc-v/src/esp32c3/esp32c3_modtext.c
rename to arch/risc-v/src/esp32c3/esp32c3_textheap.c
index 0277cb6..2285880 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_modtext.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_textheap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * arch/risc-v/src/esp32c3/esp32c3_modtext.c
+ * arch/risc-v/src/esp32c3/esp32c3_textheap.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -50,10 +50,10 @@
****************************************************************************/
/****************************************************************************
- * Name: up_module_text_init()
+ * Name: up_textheap_init()
****************************************************************************/
-void up_module_text_init()
+void up_textheap_init()
{
#ifdef CONFIG_ESP32C3_RTC_HEAP
/* Initialize the RTC heap */
@@ -63,14 +63,14 @@ void up_module_text_init()
}
/****************************************************************************
- * Name: up_module_text_memalign()
+ * Name: up_textheap_memalign()
*
* Description:
* Allocate memory for module text with the specified alignment.
*
****************************************************************************/
-FAR void *up_module_text_memalign(size_t align, size_t size)
+FAR void *up_textheap_memalign(size_t align, size_t size)
{
FAR void *ret = NULL;
@@ -99,14 +99,14 @@ FAR void *up_module_text_memalign(size_t align, size_t size)
}
/****************************************************************************
- * Name: up_module_text_free()
+ * Name: up_textheap_free()
*
* Description:
* Free memory for module text.
*
****************************************************************************/
-void up_module_text_free(FAR void *p)
+void up_textheap_free(FAR void *p)
{
if (p)
{
diff --git a/arch/sim/src/sim/up_heap.c b/arch/sim/src/sim/up_heap.c
index 16ace89..b82f629 100644
--- a/arch/sim/src/sim/up_heap.c
+++ b/arch/sim/src/sim/up_heap.c
@@ -454,7 +454,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
/* We make the entire heap executable here to keep
* the sim simpler. If it turns out to be a problem, the
- * ARCH_HAVE_MODULE_TEXT mechanism can be an alternative.
+ * ARCH_HAVE_TEXT_HEAP mechanism can be an alternative.
*/
uint8_t *sim_heap = host_alloc_heap(SIM_HEAP_SIZE);
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 34776ba..5ba2149 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -14,7 +14,7 @@ config ARCH_CHIP_ESP32
select ARCH_FAMILY_LX6
select XTENSA_HAVE_INTERRUPTS
select ARCH_HAVE_MULTICPU
- select ARCH_HAVE_MODULE_TEXT
+ select ARCH_HAVE_TEXT_HEAP
select ARCH_HAVE_SDRAM
select ARCH_HAVE_RESET
select ARCH_TOOLCHAIN_GNU
@@ -41,7 +41,7 @@ config ARCH_CHIP_ESP32S2
bool "Espressif ESP32-S2"
select ARCH_FAMILY_LX7
select XTENSA_HAVE_INTERRUPTS
- select ARCH_HAVE_MODULE_TEXT
+ select ARCH_HAVE_TEXT_HEAP
select ARCH_HAVE_SDRAM
select ARCH_HAVE_RESET
select ARCH_TOOLCHAIN_GNU
diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs
index 69981bd..964468a 100644
--- a/arch/xtensa/src/esp32/Make.defs
+++ b/arch/xtensa/src/esp32/Make.defs
@@ -180,8 +180,8 @@ CHIP_CSRCS += esp32_wdt_lowerhalf.c
endif
endif
-ifeq ($(CONFIG_ARCH_USE_MODULE_TEXT),y)
-CHIP_CSRCS += esp32_modtext.c
+ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP),y)
+CHIP_CSRCS += esp32_textheap.c
CMN_ASRCS += xtensa_loadstore.S
endif
diff --git a/arch/xtensa/src/esp32/esp32_modtext.c b/arch/xtensa/src/esp32/esp32_textheap.c
similarity index 73%
rename from arch/xtensa/src/esp32/esp32_modtext.c
rename to arch/xtensa/src/esp32/esp32_textheap.c
index 2c738d4..3821d31 100644
--- a/arch/xtensa/src/esp32/esp32_modtext.c
+++ b/arch/xtensa/src/esp32/esp32_textheap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * arch/xtensa/src/esp32/esp32_modtext.c
+ * arch/xtensa/src/esp32/esp32_textheap.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -34,63 +34,63 @@
* Public Data
****************************************************************************/
-extern uint32_t _smodtext;
-extern uint32_t _emodtext;
+extern uint32_t _stextheap;
+extern uint32_t _etextheap;
/****************************************************************************
* Private Data
****************************************************************************/
-struct mm_heap_s g_module_text;
+struct mm_heap_s g_textheap;
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: up_module_text_init
+ * Name: up_textheap_init
*
* Description:
- * Initialize the module text allocator
+ * Initialize the text heap.
*
****************************************************************************/
-void up_module_text_init()
+void up_textheap_init()
{
- mm_initialize(&g_module_text, &_smodtext, &_emodtext - &_smodtext);
+ mm_initialize(&g_textheap, &_stextheap, &_etextheap - &_stextheap);
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
- static struct procfs_meminfo_entry_s g_modtext_procfs;
+ static struct procfs_meminfo_entry_s g_textheap_procfs;
- g_modtext_procfs.name = "modtext";
- g_modtext_procfs.mallinfo = (void *)mm_mallinfo;
- g_modtext_procfs.user_data = &g_module_text;
- procfs_register_meminfo(&g_modtext_procfs);
+ g_textheap_procfs.name = "textheap";
+ g_textheap_procfs.mallinfo = (void *)mm_mallinfo;
+ g_textheap_procfs.user_data = &g_textheap;
+ procfs_register_meminfo(&g_textheap_procfs);
#endif
}
/****************************************************************************
- * Name: up_module_text_memalign
+ * Name: up_textheap_memalign
*
* Description:
- * Allocate memory for module text with the specified alignment.
+ * Allocate memory from the text heap with the specified alignment.
*
****************************************************************************/
-FAR void *up_module_text_memalign(size_t align, size_t size)
+FAR void *up_textheap_memalign(size_t align, size_t size)
{
- return mm_memalign(&g_module_text, align, size);
+ return mm_memalign(&g_textheap, align, size);
}
/****************************************************************************
- * Name: up_module_text_free
+ * Name: up_textheap_free
*
* Description:
- * Free memory for module text.
+ * Free memory from the text heap.
*
****************************************************************************/
-void up_module_text_free(FAR void *p)
+void up_textheap_free(FAR void *p)
{
- return mm_free(&g_module_text, p);
+ return mm_free(&g_textheap, p);
}
diff --git a/arch/xtensa/src/esp32/esp32_user.c b/arch/xtensa/src/esp32/esp32_user.c
index 2ca0f33..418fe79 100644
--- a/arch/xtensa/src/esp32/esp32_user.c
+++ b/arch/xtensa/src/esp32/esp32_user.c
@@ -38,9 +38,9 @@
* Public Data
****************************************************************************/
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
-extern uint32_t _smodtext;
-extern uint32_t _emodtext;
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
+extern uint32_t _stextheap;
+extern uint32_t _etextheap;
#endif
/****************************************************************************
@@ -51,7 +51,7 @@ extern uint32_t _emodtext;
* Private Functions
****************************************************************************/
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
#ifdef CONFIG_ENDIAN_BIG
#error not implemented
#endif
@@ -323,7 +323,7 @@ static void advance_pc(uint32_t *regs, int diff)
uint32_t *xtensa_user(int exccause, uint32_t *regs)
{
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
/* Emulate byte access for module text.
*
* ESP32 only allows word-aligned accesses to the instruction memory
@@ -338,8 +338,8 @@ uint32_t *xtensa_user(int exccause, uint32_t *regs)
*/
if (exccause == XCHAL_EXCCAUSE_LOAD_STORE_ERROR &&
- (uintptr_t)&_smodtext <= regs[REG_EXCVADDR] &&
- (uintptr_t)&_emodtext > regs[REG_EXCVADDR])
+ (uintptr_t)&_stextheap <= regs[REG_EXCVADDR] &&
+ (uintptr_t)&_etextheap > regs[REG_EXCVADDR])
{
uint8_t *pc = (uint8_t *)regs[REG_PC];
uint8_t imm8;
diff --git a/arch/xtensa/src/esp32s2/Make.defs b/arch/xtensa/src/esp32s2/Make.defs
index 8671272..7074f98 100644
--- a/arch/xtensa/src/esp32s2/Make.defs
+++ b/arch/xtensa/src/esp32s2/Make.defs
@@ -79,8 +79,3 @@ ifeq ($(CONFIG_ESP32S2_UART),y)
CMN_CSRCS += esp32s2_serial.c
endif
-ifeq ($(CONFIG_ARCH_USE_MODULE_TEXT),y)
-CHIP_CSRCS += esp32s2_modtext.c
-CMN_ASRCS += xtensa_loadstore.S
-endif
-
diff --git a/arch/xtensa/src/esp32s2/esp32s2_user.c b/arch/xtensa/src/esp32s2/esp32s2_user.c
index 0920fe4..d0540b6 100644
--- a/arch/xtensa/src/esp32s2/esp32s2_user.c
+++ b/arch/xtensa/src/esp32s2/esp32s2_user.c
@@ -38,9 +38,9 @@
* Public Data
****************************************************************************/
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
-extern uint32_t _smodtext;
-extern uint32_t _emodtext;
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
+extern uint32_t _stextheap;
+extern uint32_t _etextheap;
#endif
/****************************************************************************
@@ -51,7 +51,7 @@ extern uint32_t _emodtext;
* Private Functions
****************************************************************************/
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
#ifdef CONFIG_ENDIAN_BIG
#error not implemented
#endif
@@ -293,7 +293,7 @@ static void advance_pc(uint32_t *regs, int diff)
uint32_t *xtensa_user(int exccause, uint32_t *regs)
{
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
/* Emulate byte access for module text.
*
* ESP32S2 only allows word-aligned accesses to the instruction memory
@@ -308,8 +308,8 @@ uint32_t *xtensa_user(int exccause, uint32_t *regs)
*/
if (exccause == XCHAL_EXCCAUSE_LOAD_STORE_ERROR &&
- (uintptr_t)&_smodtext <= regs[REG_EXCVADDR] &&
- (uintptr_t)&_emodtext > regs[REG_EXCVADDR])
+ (uintptr_t)&_stextheap <= regs[REG_EXCVADDR] &&
+ (uintptr_t)&_etextheap > regs[REG_EXCVADDR])
{
uint8_t *pc = (uint8_t *)regs[REG_PC];
uint8_t imm8;
diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c
index 01ba6d0..5baac9e 100644
--- a/binfmt/binfmt_unloadmodule.c
+++ b/binfmt/binfmt_unloadmodule.c
@@ -166,8 +166,8 @@ int unload_module(FAR struct binary_s *binp)
if (binp->alloc[i])
{
binfo("Freeing alloc[%d]: %p\n", i, binp->alloc[i]);
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
- up_module_text_free((FAR void *)binp->alloc[i]);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+ up_textheap_free((FAR void *)binp->alloc[i]);
#else
kumm_free((FAR void *)binp->alloc[i]);
#endif
diff --git a/binfmt/libelf/libelf_addrenv.c b/binfmt/libelf/libelf_addrenv.c
index 75d924f..1fd5be9 100644
--- a/binfmt/libelf/libelf_addrenv.c
+++ b/binfmt/libelf/libelf_addrenv.c
@@ -117,10 +117,10 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t textsize,
#else
/* Allocate memory to hold the ELF image */
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
loadinfo->textalloc = (uintptr_t)
- up_module_text_memalign(loadinfo->textalign,
- textsize);
+ up_textheap_memalign(loadinfo->textalign,
+ textsize);
#else
loadinfo->textalloc = (uintptr_t)kumm_malloc(textsize + datasize);
#endif
@@ -130,7 +130,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t textsize,
return -ENOMEM;
}
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
loadinfo->dataalloc = (uintptr_t)kumm_malloc(datasize);
if (0 != datasize && !loadinfo->dataalloc)
@@ -177,10 +177,10 @@ void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo)
}
#else
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
if (loadinfo->textalloc != 0)
{
- up_module_text_free((FAR void *)loadinfo->textalloc);
+ up_textheap_free((FAR void *)loadinfo->textalloc);
}
if (loadinfo->dataalloc != 0)
diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/configs/elf/defconfig b/boards/risc-v/esp32c3/esp32c3-devkit/configs/elf/defconfig
index aaecf39..dffc31b 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/configs/elf/defconfig
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/configs/elf/defconfig
@@ -15,7 +15,7 @@ CONFIG_ARCH_CHIP_ESP32C3WROOM02=y
CONFIG_ARCH_INTERRUPTSTACK=8192
CONFIG_ARCH_RISCV=y
CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH_USE_MODULE_TEXT=y
+CONFIG_ARCH_USE_TEXT_HEAP=y
CONFIG_BOARDCTL_ROMDISK=y
CONFIG_BOARD_LOOPSPERMSEC=15000
CONFIG_BUILTIN=y
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/elf/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/elf/defconfig
index b941f33..672a529 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/elf/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/elf/defconfig
@@ -16,7 +16,7 @@ CONFIG_ARCH_CHIP="esp32"
CONFIG_ARCH_CHIP_ESP32=y
CONFIG_ARCH_CHIP_ESP32WROVER=y
CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH_USE_MODULE_TEXT=y
+CONFIG_ARCH_USE_TEXT_HEAP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARDCTL_ROMDISK=y
CONFIG_BOARD_LOOPSPERMSEC=16717
diff --git a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32.template.ld b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32.template.ld
index 22d8226..6ca7f46 100644
--- a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32.template.ld
+++ b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32.template.ld
@@ -78,6 +78,6 @@ MEMORY
_eheap = 0x40000000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM;
-/* Module text area ends at top of dram0_0_seg */
+/* Text heap ends at top of dram0_0_seg */
-_emodtext = 0x400a0000;
+_etextheap = 0x400a0000;
diff --git a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_flash.ld b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_flash.ld
index b9a6f62..cd1d4a8 100644
--- a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_flash.ld
+++ b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_flash.ld
@@ -63,10 +63,10 @@ SECTIONS
*(.phyiram .phyiram.*)
_iram_text_end = ABSOLUTE(.);
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_iram.ld b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_iram.ld
index 410c6cb..65b6823 100644
--- a/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_iram.ld
+++ b/boards/xtensa/esp32/esp32-devkitc/scripts/esp32_iram.ld
@@ -70,10 +70,10 @@ SECTIONS
_text_end = ABSOLUTE(.);
_etext = .;
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32.template.ld b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32.template.ld
index 63024c0..f9f5512 100644
--- a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32.template.ld
+++ b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32.template.ld
@@ -78,6 +78,6 @@ MEMORY
_eheap = 0x40000000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM;
-/* Module text area ends at top of dram0_0_seg */
+/* Text heap ends at top of dram0_0_seg */
-_emodtext = 0x400a0000;
+_etextheap = 0x400a0000;
diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_flash.ld b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_flash.ld
index 16a9c10..a851542 100644
--- a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_flash.ld
+++ b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_flash.ld
@@ -66,10 +66,10 @@ SECTIONS
*(.phyiram .phyiram.*)
_iram_text_end = ABSOLUTE(.);
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_iram.ld b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_iram.ld
index 06a79a4..05e7d75 100644
--- a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_iram.ld
+++ b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/esp32_iram.ld
@@ -70,10 +70,10 @@ SECTIONS
_text_end = ABSOLUTE(.);
_etext = .;
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32.template.ld b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32.template.ld
index f5ea00b..f55138a 100644
--- a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32.template.ld
+++ b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32.template.ld
@@ -78,6 +78,6 @@ MEMORY
_eheap = 0x40000000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM;
-/* Module text area ends at top of dram0_0_seg */
+/* Text heap ends at top of dram0_0_seg */
-_emodtext = 0x400a0000;
+_etextheap = 0x400a0000;
diff --git a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_flash.ld b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_flash.ld
index ac02d69..a56b542 100644
--- a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_flash.ld
+++ b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_flash.ld
@@ -66,10 +66,10 @@ SECTIONS
*(.phyiram .phyiram.*)
_iram_text_end = ABSOLUTE(.);
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_iram.ld b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_iram.ld
index 27b6042..b43ea8f 100644
--- a/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_iram.ld
+++ b/boards/xtensa/esp32/esp32-wrover-kit/scripts/esp32_iram.ld
@@ -70,10 +70,10 @@ SECTIONS
_text_end = ABSOLUTE(.);
_etext = .;
- /* Module text area starts at the end of iram0_0_seg */
+ /* Text heap starts at the end of iram0_0_seg */
. = ALIGN (4);
- _smodtext = ABSOLUTE(.);
+ _stextheap = ABSOLUTE(.);
} > iram0_0_seg
/* Shared RAM */
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index bee83c5..391eb8c 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -754,39 +754,39 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages);
#endif
/****************************************************************************
- * Name: up_module_text_init
+ * Name: up_textheap_init
*
* Description:
- * Initialize the module text allocator
+ * Initialize the text heap.
*
****************************************************************************/
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
-void up_module_text_init(void);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+void up_textheap_init(void);
#endif
/****************************************************************************
- * Name: up_module_text_memalign
+ * Name: up_textheap_memalign
*
* Description:
- * Allocate memory for module text with the specified alignment.
+ * Allocate memory from the text heap with the specified alignment.
*
****************************************************************************/
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
-FAR void *up_module_text_memalign(size_t align, size_t size);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+FAR void *up_textheap_memalign(size_t align, size_t size);
#endif
/****************************************************************************
- * Name: up_module_text_free
+ * Name: up_textheap_free
*
* Description:
- * Free memory for module text.
+ * Free memory from the text heap.
*
****************************************************************************/
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
-void up_module_text_free(FAR void *p);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+void up_textheap_free(FAR void *p);
#endif
/****************************************************************************
diff --git a/include/nuttx/binfmt/elf.h b/include/nuttx/binfmt/elf.h
index 572e0b8..a42c483 100644
--- a/include/nuttx/binfmt/elf.h
+++ b/include/nuttx/binfmt/elf.h
@@ -95,7 +95,7 @@ struct elf_loadinfo_s
uintptr_t textalloc; /* .text memory allocated when ELF file was loaded */
uintptr_t dataalloc; /* .bss/.data memory allocated when ELF file was loaded */
size_t textsize; /* Size of the ELF .text memory allocation */
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
size_t textalign; /* Necessary alignment of .text */
#endif
size_t datasize; /* Size of the ELF .bss/.data memory allocation */
diff --git a/libs/libc/modlib/Kconfig b/libs/libc/modlib/Kconfig
index 4f9e78d..a1529fa 100644
--- a/libs/libc/modlib/Kconfig
+++ b/libs/libc/modlib/Kconfig
@@ -7,7 +7,7 @@ config LIBC_MODLIB
bool
default n
select LIBC_ARCH_ELF
- select ARCH_USE_MODULE_TEXT if ARCH_HAVE_MODULE_TEXT
+ select ARCH_USE_TEXT_HEAP if ARCH_HAVE_TEXT_HEAP
menu "Module library configuration"
depends on LIBC_MODLIB
diff --git a/libs/libc/modlib/modlib_load.c b/libs/libc/modlib/modlib_load.c
index efe936d..049a655 100644
--- a/libs/libc/modlib/modlib_load.c
+++ b/libs/libc/modlib/modlib_load.c
@@ -265,10 +265,10 @@ int modlib_load(FAR struct mod_loadinfo_s *loadinfo)
if (loadinfo->textsize > 0)
{
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
loadinfo->textalloc = (uintptr_t)
- up_module_text_memalign(loadinfo->textalign,
- loadinfo->textsize);
+ up_textheap_memalign(loadinfo->textalign,
+ loadinfo->textsize);
#else
loadinfo->textalloc = (uintptr_t)lib_memalign(loadinfo->textalign,
loadinfo->textsize);
diff --git a/libs/libc/modlib/modlib_unload.c b/libs/libc/modlib/modlib_unload.c
index 0e4a61a..3ac6026 100644
--- a/libs/libc/modlib/modlib_unload.c
+++ b/libs/libc/modlib/modlib_unload.c
@@ -60,8 +60,8 @@ int modlib_unload(struct mod_loadinfo_s *loadinfo)
if (loadinfo->textalloc != 0)
{
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
- up_module_text_free((FAR void *)loadinfo->textalloc);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+ up_textheap_free((FAR void *)loadinfo->textalloc);
#else
lib_free((FAR void *)loadinfo->textalloc);
#endif
diff --git a/sched/Kconfig b/sched/Kconfig
index 65b2a5c..66cb55f 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -1545,7 +1545,7 @@ config MODULE
bool "Enable loadable OS modules"
default n
select LIBC_MODLIB
- select ARCH_USE_MODULE_TEXT if ARCH_HAVE_MODULE_TEXT
+ select ARCH_USE_TEXT_HEAP if ARCH_HAVE_TEXT_HEAP
---help---
Enable support for loadable OS modules. Default: n
diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c
index aa6867a..d6b86f4 100644
--- a/sched/init/nx_start.c
+++ b/sched/init/nx_start.c
@@ -572,8 +572,8 @@ void nx_start(void)
}
#endif
-#ifdef CONFIG_ARCH_USE_MODULE_TEXT
- up_module_text_init();
+#ifdef CONFIG_ARCH_USE_TEXT_HEAP
+ up_textheap_init();
#endif
#ifdef CONFIG_MM_IOB
diff --git a/sched/module/mod_rmmod.c b/sched/module/mod_rmmod.c
index 6d03ef9..490beaf 100644
--- a/sched/module/mod_rmmod.c
+++ b/sched/module/mod_rmmod.c
@@ -120,8 +120,8 @@ int rmmod(FAR void *handle)
* and nullify so that the memory cannot be freed again
*/
-#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
- up_module_text_free((FAR void *)modp->textalloc);
+#if defined(CONFIG_ARCH_USE_TEXT_HEAP)
+ up_textheap_free((FAR void *)modp->textalloc);
#else
kmm_free((FAR void *)modp->textalloc);
#endif