cache: invalidate addr hal api

This commit is contained in:
Armando
2022-10-17 12:40:05 +08:00
parent 16398c2d06
commit 1fc55af6af
2 changed files with 16 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include "hal/cache_hal.h"
#include "hal/cache_types.h"
#include "hal/cache_ll.h"
#include "hal/mmu_ll.h"
#include "soc/soc_caps.h"
#if CONFIG_IDF_TARGET_ESP32S2
@@ -112,3 +113,10 @@ void cache_hal_enable(cache_type_t type)
}
#endif
}
void cache_hal_invalidate_addr(uint32_t vaddr, uint32_t size)
{
//Now only esp32 has 2 MMUs, this file doesn't build on esp32
HAL_ASSERT(mmu_ll_check_valid_ext_vaddr_region(0, vaddr, size));
Cache_Invalidate_Addr(vaddr, size);
}

View File

@@ -36,6 +36,14 @@ void cache_hal_disable(cache_type_t type);
*/
void cache_hal_enable(cache_type_t type);
/**
* Invalidate a Cache item for either ICache or DCache.
*
* @param vaddr Start address of the region to be invalidated
* @param size Size of the region to be invalidated
*/
void cache_hal_invalidate_addr(uint32_t vaddr, uint32_t size);
#ifdef __cplusplus
}
#endif