change(cache): swap cache hal arg 'type' and 'level'

This commit is contained in:
Armando
2023-09-15 20:11:52 +08:00
parent 0a1503897c
commit ec27891af6
20 changed files with 70 additions and 69 deletions

View File

@@ -14,7 +14,7 @@ static uint32_t s_cache_status[2];
* There's a bug that Cache_Read_Disable requires a call to Cache_Flush
* before Cache_Read_Enable, even if cached data was not modified.
*/
void cache_hal_suspend(cache_type_t type, uint32_t cache_level)
void cache_hal_suspend(uint32_t cache_level, cache_type_t type)
{
s_cache_status[0] = cache_ll_l1_get_enabled_bus(0);
cache_ll_l1_disable_cache(0);
@@ -25,7 +25,7 @@ void cache_hal_suspend(cache_type_t type, uint32_t cache_level)
}
void cache_hal_resume(cache_type_t type, uint32_t cache_level)
void cache_hal_resume(uint32_t cache_level, cache_type_t type)
{
cache_ll_l1_enable_cache(0);
cache_ll_l1_enable_bus(0, s_cache_status[0]);
@@ -36,7 +36,7 @@ void cache_hal_resume(cache_type_t type, uint32_t cache_level)
}
bool cache_hal_is_cache_enabled(cache_type_t type, uint32_t cache_level)
bool cache_hal_is_cache_enabled(uint32_t cache_level, cache_type_t type)
{
bool result = cache_ll_l1_is_cache_enabled(0, CACHE_TYPE_ALL);
#if !CONFIG_FREERTOS_UNICORE
@@ -53,7 +53,7 @@ bool cache_hal_vaddr_to_cache_level_id(uint32_t vaddr_start, uint32_t len, uint3
return cache_ll_vaddr_to_cache_level_id(vaddr_start, len, out_level, out_id);
}
uint32_t cache_hal_get_cache_line_size(cache_type_t type, uint32_t cache_level)
uint32_t cache_hal_get_cache_line_size(uint32_t cache_level, cache_type_t type)
{
HAL_ASSERT(cache_level && (cache_level <= CACHE_LL_LEVEL_NUMS));
return 4;