feat(cache): added cache invalidate all ll apis

This commit is contained in:
Armando
2024-12-18 11:30:51 +08:00
parent 13e8541007
commit f1b0c5dcb4
9 changed files with 207 additions and 4 deletions

View File

@@ -360,6 +360,32 @@ static inline void cache_ll_invalidate_addr(uint32_t cache_level, cache_type_t t
Cache_Invalidate_Addr(vaddr, size);
}
/**
* @brief Invalidate all
*
* @param cache_level level of the cache
* @param type see `cache_type_t`
* @param cache_id id of the cache in this type and level
*/
__attribute__((always_inline))
static inline void cache_ll_invalidate_all(uint32_t cache_level, cache_type_t type, uint32_t cache_id)
{
switch (type)
{
case CACHE_TYPE_DATA:
Cache_Invalidate_DCache_All();
break;
case CACHE_TYPE_INSTRUCTION:
Cache_Invalidate_ICache_All();
break;
default: //CACHE_TYPE_ALL
Cache_Invalidate_ICache_All();
Cache_Invalidate_DCache_All();
break;
}
}
/**
* @brief Writeback cache supported addr
*