fix(hal): Fix the external memory vaddr region validity check

- For c6 and h2, the vaddr end calculated was off by 1
  byte.
This commit is contained in:
Laukik Hase 2023-07-31 15:11:49 +05:30
parent d3c99ed3b8
commit a0da805f2b
No known key found for this signature in database
GPG Key ID: D6F3208C06086AC8
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ static inline bool mmu_ll_check_valid_ext_vaddr_region(uint32_t mmu_id, uint32_t
{ {
(void)mmu_id; (void)mmu_id;
(void)type; (void)type;
uint32_t vaddr_end = vaddr_start + len; uint32_t vaddr_end = vaddr_start + len - 1;
return (ADDRESS_IN_IRAM0_CACHE(vaddr_start) && ADDRESS_IN_IRAM0_CACHE(vaddr_end)) || (ADDRESS_IN_DRAM0_CACHE(vaddr_start) && ADDRESS_IN_DRAM0_CACHE(vaddr_end)); return (ADDRESS_IN_IRAM0_CACHE(vaddr_start) && ADDRESS_IN_IRAM0_CACHE(vaddr_end)) || (ADDRESS_IN_DRAM0_CACHE(vaddr_start) && ADDRESS_IN_DRAM0_CACHE(vaddr_end));
} }

View File

@ -105,7 +105,7 @@ static inline bool mmu_ll_check_valid_ext_vaddr_region(uint32_t mmu_id, uint32_t
{ {
(void)mmu_id; (void)mmu_id;
(void)type; (void)type;
uint32_t vaddr_end = vaddr_start + len; uint32_t vaddr_end = vaddr_start + len - 1;
return (ADDRESS_IN_IRAM0_CACHE(vaddr_start) && ADDRESS_IN_IRAM0_CACHE(vaddr_end)) || (ADDRESS_IN_DRAM0_CACHE(vaddr_start) && ADDRESS_IN_DRAM0_CACHE(vaddr_end)); return (ADDRESS_IN_IRAM0_CACHE(vaddr_start) && ADDRESS_IN_IRAM0_CACHE(vaddr_end)) || (ADDRESS_IN_DRAM0_CACHE(vaddr_start) && ADDRESS_IN_DRAM0_CACHE(vaddr_end));
} }