refactor(psram): rename .bss .noinit segments to sections

Closes https://github.com/espressif/esp-idf/pull/15513
This commit is contained in:
armando
2025-03-10 14:42:50 +08:00
parent 90611532a2
commit 09a0884ced

View File

@ -266,30 +266,30 @@ esp_err_t esp_psram_init(void)
* After mapping, we DON'T care about the PSRAM PHYSICAL ADDRESSS ANYMORE! * After mapping, we DON'T care about the PSRAM PHYSICAL ADDRESSS ANYMORE!
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
//------------------------------------Configure heap in PSRAM-------------------------------------// //------------------------------------Configure other sections in PSRAM-------------------------------------//
uintptr_t ext_segment_start = UINTPTR_MAX; uintptr_t ext_section_start = UINTPTR_MAX;
uintptr_t ext_segment_end = 0; uintptr_t ext_section_end = 0;
#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY #if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
ext_segment_start = (uintptr_t)&_ext_ram_bss_start; ext_section_start = (uintptr_t)&_ext_ram_bss_start;
ext_segment_end = (uintptr_t)&_ext_ram_bss_end; ext_section_end = (uintptr_t)&_ext_ram_bss_end;
#endif //#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY #endif //#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
#if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY #if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY
if ((uintptr_t)&_ext_ram_noinit_start < ext_segment_start) { if ((uintptr_t)&_ext_ram_noinit_start < ext_section_start) {
ext_segment_start = (uintptr_t)&_ext_ram_noinit_start; ext_section_start = (uintptr_t)&_ext_ram_noinit_start;
} }
if ((uintptr_t)&_ext_ram_noinit_end > ext_segment_end) { if ((uintptr_t)&_ext_ram_noinit_end > ext_section_end) {
ext_segment_end = (uintptr_t)&_ext_ram_noinit_end; ext_section_end = (uintptr_t)&_ext_ram_noinit_end;
} }
#endif //#if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY #endif //#if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY
if ((ext_segment_start != UINTPTR_MAX) || (ext_segment_end != 0)) { if ((ext_section_start != UINTPTR_MAX) || (ext_section_end != 0)) {
assert(ext_segment_end >= ext_segment_start); assert(ext_section_end >= ext_section_start);
uint32_t ext_segment_size = ext_segment_end - ext_segment_start; uint32_t ext_section_size = ext_section_end - ext_section_start;
ESP_EARLY_LOGV(TAG, "ext_segment_size is %" PRIu32, ext_segment_size); ESP_EARLY_LOGV(TAG, "ext_section_size is %" PRIu32, ext_section_size);
s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].vaddr_start += ext_segment_size; s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].vaddr_start += ext_section_size;
s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].size -= ext_segment_size; s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].size -= ext_section_size;
} }
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32