change(mem): deprecated tcm and added scp memory utils

This commit is contained in:
armando
2026-03-18 09:48:08 +08:00
parent fe2cc0a64c
commit 01942e4eef
30 changed files with 165 additions and 120 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2010-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2010-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -196,19 +196,31 @@ inline static void * esp_ptr_diram_iram_to_dram(const void *p) {
#endif
}
#if SOC_MEM_TCM_SUPPORTED
#if SOC_MEM_SCP_SUPPORTED
/**
* @brief Check if the pointer is in TCM
* @brief Check if the pointer is in TCM (SCP)
*
* @param p pointer
*
* @return true: is in TCM; false: not in TCM
* @return true: is in TCM (SCP); false: not in TCM (SCP)
*/
__attribute__((always_inline))
__attribute__((always_inline, deprecated("esp_ptr_in_tcm is deprecated, please use esp_ptr_in_scp instead")))
inline static bool esp_ptr_in_tcm(const void *p) {
return ((intptr_t)p >= SOC_TCM_LOW && (intptr_t)p < SOC_TCM_HIGH);
return ((intptr_t)p >= SOC_SCP_LOW && (intptr_t)p < SOC_SCP_HIGH);
}
#endif //#if SOC_MEM_TCM_SUPPORTED
/**
* @brief Check if the pointer is in SCP
*
* @param p pointer
*
* @return true: is in SCP; false: not in SCP
*/
__attribute__((always_inline))
inline static bool esp_ptr_in_scp(const void *p) {
return ((intptr_t)p >= SOC_SCP_LOW && (intptr_t)p < SOC_SCP_HIGH);
}
#endif //#if SOC_MEM_SCP_SUPPORTED
/** End of common functions to be kept in sync with bootloader_memory_utils.h **/
/** Add app-specific functions below **/
@@ -278,8 +290,8 @@ inline static bool esp_ptr_internal(const void *p) {
bool r;
r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH);
#if SOC_MEM_TCM_SUPPORTED
r |= esp_ptr_in_tcm(p);
#if SOC_MEM_SCP_SUPPORTED
r |= esp_ptr_in_scp(p);
#endif
#if SOC_RTC_SLOW_MEM_SUPPORTED