You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2024/05/15 13:45:17 UTC
(nuttx) branch master updated: esp32s3_textheap.c: fix range checks
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 5df4925672 esp32s3_textheap.c: fix range checks
5df4925672 is described below
commit 5df492567242bbc911212d6c3ca67f6c47c6c494
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed May 15 09:30:13 2024 +0900
esp32s3_textheap.c: fix range checks
While there constants are commented as "First and last words of the
D/IRAM region", the _HIGH addresses are actually not in the corresponding
region.
---
arch/xtensa/src/esp32s3/esp32s3_textheap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/xtensa/src/esp32s3/esp32s3_textheap.c b/arch/xtensa/src/esp32s3/esp32s3_textheap.c
index 728749ee14..a7551ede73 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_textheap.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_textheap.c
@@ -93,7 +93,7 @@ void *up_textheap_memalign(size_t align, size_t size)
*/
uintptr_t addr = (uintptr_t)ret;
- if (SOC_DIRAM_DRAM_LOW <= addr && addr <= SOC_DIRAM_DRAM_HIGH)
+ if (SOC_DIRAM_DRAM_LOW <= addr && addr < SOC_DIRAM_DRAM_HIGH)
{
addr = MAP_DRAM_TO_IRAM(addr);
}
@@ -135,7 +135,7 @@ void up_textheap_free(void *p)
#endif
{
uintptr_t addr = (uintptr_t)p;
- if (SOC_DIRAM_IRAM_LOW <= addr && addr <= SOC_DIRAM_IRAM_HIGH)
+ if (SOC_DIRAM_IRAM_LOW <= addr && addr < SOC_DIRAM_IRAM_HIGH)
{
addr = MAP_IRAM_TO_DRAM(addr);
}
@@ -181,7 +181,7 @@ bool up_textheap_heapmember(void *p)
#endif
uintptr_t addr = (uintptr_t)p;
- if (SOC_DIRAM_IRAM_LOW <= addr && addr <= SOC_DIRAM_IRAM_HIGH)
+ if (SOC_DIRAM_IRAM_LOW <= addr && addr < SOC_DIRAM_IRAM_HIGH)
{
addr = MAP_IRAM_TO_DRAM(addr);
}