Skip to content

Commit d406826

Browse files
committed
zephyr: use system cache APIs instead of custom soc calls
Signed-off-by: Anas Nashif <[email protected]>
1 parent c698a57 commit d406826

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

zephyr/lib/alloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static inline uintptr_t get_l3_heap_start(void)
116116
* - main_fw_load_offset
117117
* - main fw size in manifest
118118
*/
119-
return (uintptr_t)z_soc_uncached_ptr((__sparse_force void __sparse_cache *)
119+
return (uintptr_t)sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)
120120
ROUND_UP(IMR_L3_HEAP_BASE, L3_MEM_PAGE_SIZE));
121121
}
122122

@@ -146,7 +146,7 @@ static bool is_l3_heap_pointer(void *ptr)
146146
uintptr_t l3_heap_end = l3_heap_start + get_l3_heap_size();
147147

148148
if (is_cached(ptr))
149-
ptr = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)ptr);
149+
ptr = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)ptr);
150150

151151
if ((POINTER_TO_UINT(ptr) >= l3_heap_start) && (POINTER_TO_UINT(ptr) < l3_heap_end))
152152
return true;
@@ -199,7 +199,7 @@ static void __sparse_cache *heap_alloc_aligned_cached(struct k_heap *h,
199199

200200
#ifdef CONFIG_SOF_ZEPHYR_HEAP_CACHED
201201
if (ptr)
202-
ptr = z_soc_cached_ptr((__sparse_force void *)ptr);
202+
ptr = sys_cache_cached_ptr_get((__sparse_force void *)ptr);
203203
#endif
204204

205205
return ptr;
@@ -212,7 +212,7 @@ static void heap_free(struct k_heap *h, void *mem)
212212
void *mem_uncached;
213213

214214
if (is_cached(mem)) {
215-
mem_uncached = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)mem);
215+
mem_uncached = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)mem);
216216
sys_cache_data_flush_and_invd_range(mem,
217217
sys_heap_usable_size(&h->heap, mem_uncached));
218218

0 commit comments

Comments
 (0)