mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
change(esp_psram): Consider all PSRAM regions in PMP protection
This commit is contained in:
committed by
Mahavir Jain
parent
10d2d9cb9f
commit
d1d45ff256
@@ -778,7 +778,11 @@ static size_t esp_psram_get_effective_mapped_size(void)
|
||||
}
|
||||
|
||||
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 {
|
||||
uint32_t psram_available_size = 0;
|
||||
esp_err_t ret = esp_psram_impl_get_available_size(&psram_available_size);
|
||||
@@ -817,7 +821,11 @@ size_t esp_psram_get_heap_size_to_protect(void)
|
||||
}
|
||||
|
||||
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 {
|
||||
size_t effective_mapped_size = esp_psram_get_effective_mapped_size();
|
||||
if (effective_mapped_size == 0) {
|
||||
|
||||
Reference in New Issue
Block a user