mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +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")))
|
#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
|
#ifdef CONFIG_XTENSA_EXTMEM_BSS
|
||||||
# define EXT_RAM_ATTR __attribute__((section(".extmem.bss")))
|
# define EXT_RAM_ATTR __attribute__((section(".extmem.bss")))
|
||||||
|
#else
|
||||||
|
# define EXT_RAM_ATTR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ARCH_XTENSA_SRC_COMMON_XTENSA_ATTR_H */
|
#endif /* __ARCH_XTENSA_SRC_COMMON_XTENSA_ATTR_H */
|
||||||
|
|||||||
@@ -148,11 +148,16 @@ void xtensa_add_region(void)
|
|||||||
umm_addregion(start, size);
|
umm_addregion(start, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ESP32_SPIRAM)
|
#ifdef CONFIG_ESP32_SPIRAM
|
||||||
/* Check for any additional memory regions */
|
|
||||||
|
|
||||||
# if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE)
|
# 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
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user