mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
change(esp_psram): Consider all PSRAM regions in PMP protection
This commit is contained in:
@@ -788,7 +788,11 @@ static size_t esp_psram_get_effective_mapped_size(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s_psram_ctx.is_initialised) {
|
if (s_psram_ctx.is_initialised) {
|
||||||
return s_psram_ctx.mapped_regions[PSRAM_MEM_8BIT_ALIGNED].size + s_psram_ctx.mapped_regions[PSRAM_MEM_32BIT_ALIGNED].size;
|
size_t mapped = 0;
|
||||||
|
for (int i = 0; i < PSRAM_MEM_TYPE_NUM; i++) {
|
||||||
|
mapped += s_psram_ctx.mapped_regions[i].size;
|
||||||
|
}
|
||||||
|
return mapped;
|
||||||
} else {
|
} else {
|
||||||
uint32_t psram_available_size = 0;
|
uint32_t psram_available_size = 0;
|
||||||
esp_err_t ret = esp_psram_impl_get_available_size(&psram_available_size);
|
esp_err_t ret = esp_psram_impl_get_available_size(&psram_available_size);
|
||||||
@@ -827,7 +831,11 @@ size_t esp_psram_get_heap_size_to_protect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s_psram_ctx.is_initialised) {
|
if (s_psram_ctx.is_initialised) {
|
||||||
return s_psram_ctx.regions_to_heap[PSRAM_MEM_8BIT_ALIGNED].size + s_psram_ctx.regions_to_heap[PSRAM_MEM_32BIT_ALIGNED].size;
|
size_t heap = 0;
|
||||||
|
for (int i = 0; i < PSRAM_MEM_TYPE_NUM; i++) {
|
||||||
|
heap += s_psram_ctx.regions_to_heap[i].size;
|
||||||
|
}
|
||||||
|
return heap;
|
||||||
} else {
|
} else {
|
||||||
size_t effective_mapped_size = esp_psram_get_effective_mapped_size();
|
size_t effective_mapped_size = esp_psram_get_effective_mapped_size();
|
||||||
if (effective_mapped_size == 0) {
|
if (effective_mapped_size == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user