mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
Merge branch 'fix/memory-utils-ptr-executable' into 'master'
fix(memory-utils): Missing case in esp_ptr_executable logic Closes IDF-12458 See merge request espressif/esp-idf!36904
This commit is contained in:
commit
7e93f4b5ed
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2010-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -29,6 +29,24 @@ bool esp_ptr_dma_ext_capable(const void *p)
|
|||||||
#endif //CONFIG_SPIRAM
|
#endif //CONFIG_SPIRAM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool esp_ptr_executable(const void *p)
|
||||||
|
{
|
||||||
|
intptr_t ip = (intptr_t) p;
|
||||||
|
return (ip >= SOC_IROM_LOW && ip < SOC_IROM_HIGH)
|
||||||
|
|| (ip >= SOC_IRAM_LOW && ip < SOC_IRAM_HIGH)
|
||||||
|
|| (ip >= SOC_IROM_MASK_LOW && ip < SOC_IROM_MASK_HIGH)
|
||||||
|
#if SOC_SPIRAM_SUPPORTED && CONFIG_SPIRAM
|
||||||
|
|| esp_ptr_external_ram(p)
|
||||||
|
#endif
|
||||||
|
#if defined(SOC_CACHE_APP_LOW) && defined(CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
|
||||||
|
|| (ip >= SOC_CACHE_APP_LOW && ip < SOC_CACHE_APP_HIGH)
|
||||||
|
#endif
|
||||||
|
#if SOC_RTC_FAST_MEM_SUPPORTED
|
||||||
|
|| (ip >= SOC_RTC_IRAM_LOW && ip < SOC_RTC_IRAM_HIGH)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
bool esp_ptr_byte_accessible(const void *p)
|
bool esp_ptr_byte_accessible(const void *p)
|
||||||
{
|
{
|
||||||
intptr_t ip = (intptr_t) p;
|
intptr_t ip = (intptr_t) p;
|
||||||
|
@ -246,21 +246,7 @@ inline static bool esp_ptr_word_aligned(const void *p)
|
|||||||
*
|
*
|
||||||
* @return true: is executable; false: not executable
|
* @return true: is executable; false: not executable
|
||||||
*/
|
*/
|
||||||
__attribute__((always_inline))
|
bool esp_ptr_executable(const void *p);
|
||||||
inline static bool esp_ptr_executable(const void *p)
|
|
||||||
{
|
|
||||||
intptr_t ip = (intptr_t) p;
|
|
||||||
return (ip >= SOC_IROM_LOW && ip < SOC_IROM_HIGH)
|
|
||||||
|| (ip >= SOC_IRAM_LOW && ip < SOC_IRAM_HIGH)
|
|
||||||
|| (ip >= SOC_IROM_MASK_LOW && ip < SOC_IROM_MASK_HIGH)
|
|
||||||
#if defined(SOC_CACHE_APP_LOW) && defined(CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
|
|
||||||
|| (ip >= SOC_CACHE_APP_LOW && ip < SOC_CACHE_APP_HIGH)
|
|
||||||
#endif
|
|
||||||
#if SOC_RTC_FAST_MEM_SUPPORTED
|
|
||||||
|| (ip >= SOC_RTC_IRAM_LOW && ip < SOC_RTC_IRAM_HIGH)
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the pointer is byte accessible
|
* @brief Check if the pointer is byte accessible
|
||||||
|
Loading…
x
Reference in New Issue
Block a user