modlib: Always use separate allocation for text and data

Pros:

* Reduce code differences
* Smaller allocations for !CONFIG_ARCH_USE_MODULE_TEXT

Cons:

* Likely to use more memory for !CONFIG_ARCH_USE_MODULE_TEXT in total

Tested with:

* sim:module on macOS
* esp32-devkit:nsh + CONFIG_MODULE on qemu
* lm3s6965-ek:qemu-protected + CONFIG_EXAMPLES_SOTEST on qemu
This commit is contained in:
YAMAMOTO Takashi
2021-04-15 11:33:48 +09:00
committed by Xiang Xiao
parent 1a9e7efde5
commit 418e11b8b3
8 changed files with 30 additions and 65 deletions
-4
View File
@@ -159,12 +159,8 @@ struct module_s
mod_initializer_t initializer; /* Module initializer function */
#endif
struct mod_info_s modinfo; /* Module information */
#if defined(CONFIG_ARCH_USE_MODULE_TEXT)
FAR void *textalloc; /* Allocated kernel text memory */
FAR void *dataalloc; /* Allocated kernel memory */
#else
FAR void *alloc; /* Allocated kernel memory */
#endif
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
size_t textsize; /* Size of the kernel .text memory allocation */
size_t datasize; /* Size of the kernel .bss/.data memory allocation */