From 09a0884ced0adddf71ec9da9947d1cc684437d2e Mon Sep 17 00:00:00 2001 From: armando Date: Mon, 10 Mar 2025 14:42:50 +0800 Subject: [PATCH] refactor(psram): rename .bss .noinit segments to sections Closes https://github.com/espressif/esp-idf/pull/15513 --- components/esp_psram/esp_psram.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/components/esp_psram/esp_psram.c b/components/esp_psram/esp_psram.c index c7020def52..24f31016d8 100644 --- a/components/esp_psram/esp_psram.c +++ b/components/esp_psram/esp_psram.c @@ -266,30 +266,30 @@ esp_err_t esp_psram_init(void) * After mapping, we DON'T care about the PSRAM PHYSICAL ADDRESSS ANYMORE! *----------------------------------------------------------------------------*/ - //------------------------------------Configure heap in PSRAM-------------------------------------// - uintptr_t ext_segment_start = UINTPTR_MAX; - uintptr_t ext_segment_end = 0; + //------------------------------------Configure other sections in PSRAM-------------------------------------// + uintptr_t ext_section_start = UINTPTR_MAX; + uintptr_t ext_section_end = 0; #if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY - ext_segment_start = (uintptr_t)&_ext_ram_bss_start; - ext_segment_end = (uintptr_t)&_ext_ram_bss_end; + ext_section_start = (uintptr_t)&_ext_ram_bss_start; + ext_section_end = (uintptr_t)&_ext_ram_bss_end; #endif //#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY #if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY - if ((uintptr_t)&_ext_ram_noinit_start < ext_segment_start) { - ext_segment_start = (uintptr_t)&_ext_ram_noinit_start; + if ((uintptr_t)&_ext_ram_noinit_start < ext_section_start) { + ext_section_start = (uintptr_t)&_ext_ram_noinit_start; } - if ((uintptr_t)&_ext_ram_noinit_end > ext_segment_end) { - ext_segment_end = (uintptr_t)&_ext_ram_noinit_end; + if ((uintptr_t)&_ext_ram_noinit_end > ext_section_end) { + ext_section_end = (uintptr_t)&_ext_ram_noinit_end; } #endif //#if CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY - if ((ext_segment_start != UINTPTR_MAX) || (ext_segment_end != 0)) { - assert(ext_segment_end >= ext_segment_start); - uint32_t ext_segment_size = ext_segment_end - ext_segment_start; - ESP_EARLY_LOGV(TAG, "ext_segment_size is %" PRIu32, ext_segment_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].size -= ext_segment_size; + if ((ext_section_start != UINTPTR_MAX) || (ext_section_end != 0)) { + assert(ext_section_end >= ext_section_start); + uint32_t ext_section_size = ext_section_end - ext_section_start; + 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_section_size; + s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].size -= ext_section_size; } #if CONFIG_IDF_TARGET_ESP32