mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible
Modifies `esp_ptr_internal` and `esp_ptr_byte_accessible` to also check TCM when `SOC_MEM_TCM_SUPPORTED`.
This commit is contained in:
committed by
Guillaume Souchere
parent
4a189516c7
commit
b9f42e7bae
@@ -52,6 +52,9 @@ bool esp_ptr_byte_accessible(const void *p)
|
|||||||
intptr_t ip = (intptr_t) p;
|
intptr_t ip = (intptr_t) p;
|
||||||
bool r;
|
bool r;
|
||||||
r = (ip >= SOC_BYTE_ACCESSIBLE_LOW && ip < SOC_BYTE_ACCESSIBLE_HIGH);
|
r = (ip >= SOC_BYTE_ACCESSIBLE_LOW && ip < SOC_BYTE_ACCESSIBLE_HIGH);
|
||||||
|
#if SOC_MEM_TCM_SUPPORTED
|
||||||
|
r |= (ip >= SOC_TCM_LOW && ip < SOC_TCM_HIGH);
|
||||||
|
#endif
|
||||||
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
|
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
|
||||||
/* For ESP32 case, RTC fast memory is accessible to PRO cpu only and hence
|
/* For ESP32 case, RTC fast memory is accessible to PRO cpu only and hence
|
||||||
* for single core configuration (where it gets added to system heap) following
|
* for single core configuration (where it gets added to system heap) following
|
||||||
|
@@ -278,6 +278,10 @@ inline static bool esp_ptr_internal(const void *p) {
|
|||||||
bool r;
|
bool r;
|
||||||
r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH);
|
r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH);
|
||||||
|
|
||||||
|
#if SOC_MEM_TCM_SUPPORTED
|
||||||
|
r |= ((intptr_t)p >= SOC_TCM_LOW && (intptr_t)p < SOC_TCM_HIGH);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SOC_RTC_SLOW_MEM_SUPPORTED
|
#if SOC_RTC_SLOW_MEM_SUPPORTED
|
||||||
r |= ((intptr_t)p >= SOC_RTC_DATA_LOW && (intptr_t)p < SOC_RTC_DATA_HIGH);
|
r |= ((intptr_t)p >= SOC_RTC_DATA_LOW && (intptr_t)p < SOC_RTC_DATA_HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user