fix(cache): fixed preload ascending issue

This commit is contained in:
armando
2026-04-13 13:26:08 +08:00
committed by Armando (Dou Yiwen)
parent 338f341110
commit 0099a7fff1
17 changed files with 154 additions and 72 deletions
+10 -2
View File
@@ -52,6 +52,7 @@ typedef enum {
CACHE_LL_PRELOAD_ARBITRARY = 2,
} cache_ll_preload_strategy_t;
/**
* @brief Initialize the cache clock
*/
@@ -227,16 +228,23 @@ static inline void cache_ll_preload_set_strategy(uint32_t cache_level, cache_typ
* Starts preload for the given region and does not wait. Use
* cache_ll_preload_wait_done() to wait for completion.
* DATA type is no-op.
*
* @param cache_level level of the cache (must be CACHE_LL_LEVEL_EXT_MEM)
* @param type see `cache_type_t` (only INSTRUCTION and ALL trigger preload)
* @param cache_id id of the cache (unused on C3; pass 0 or CACHE_LL_ID_ALL)
* @param vaddr start virtual address of the preload region
* @param size size of the preload region in bytes
* @param order preload order, see `cache_preload_order_t`
*/
__attribute__((always_inline))
static inline void cache_ll_preload(uint32_t cache_level, cache_type_t type, uint32_t cache_id, uint32_t vaddr, uint32_t size, bool ascending)
static inline void cache_ll_preload(uint32_t cache_level, cache_type_t type, uint32_t cache_id, uint32_t vaddr, uint32_t size, cache_preload_order_t order)
{
(void)cache_id;
HAL_ASSERT(cache_level == CACHE_LL_LEVEL_EXT_MEM);
if (type == CACHE_TYPE_DATA) {
return;
}
Cache_Start_ICache_Preload(vaddr, size, ascending ? 0 : 1);
Cache_Start_ICache_Preload(vaddr, size, order);
}
/**