mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
esp32_allocateheap.c: Adjust the region of the heap coming from the
external memory when a BSS section is allowed to reside there. Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
committed by
YAMAMOTO Takashi
parent
cc23bdeca4
commit
fcafacb9a3
@@ -69,10 +69,12 @@
|
||||
|
||||
#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata")))
|
||||
|
||||
/* Forces bss variable into external memory. */
|
||||
/* Allow bss variables into external memory. */
|
||||
|
||||
#ifdef CONFIG_XTENSA_EXTMEM_BSS
|
||||
# define EXT_RAM_ATTR __attribute__((section(".extmem.bss")))
|
||||
#else
|
||||
# define EXT_RAM_ATTR
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_XTENSA_SRC_COMMON_XTENSA_ATTR_H */
|
||||
|
||||
@@ -148,11 +148,16 @@ void xtensa_add_region(void)
|
||||
umm_addregion(start, size);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ESP32_SPIRAM)
|
||||
/* Check for any additional memory regions */
|
||||
|
||||
#ifdef CONFIG_ESP32_SPIRAM
|
||||
# if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE)
|
||||
umm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
# ifdef CONFIG_XTENSA_EXTMEM_BSS
|
||||
start = (FAR void *)(&_ebss_extmem);
|
||||
size = CONFIG_HEAP2_SIZE - (size_t)(&_ebss_extmem - &_sbss_extmem);
|
||||
# else
|
||||
start = (FAR void *)CONFIG_HEAP2_BASE;
|
||||
size = CONFIG_HEAP2_SIZE;
|
||||
# endif
|
||||
umm_addregion(start, size);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user