Lines Matching refs:cache
44 static inline bool is_cache_busy(NRF_CACHE_Type *cache) in is_cache_busy() argument
47 return nrf_cache_busy_check(cache); in is_cache_busy()
53 static inline void wait_for_cache(NRF_CACHE_Type *cache) in wait_for_cache() argument
55 while (is_cache_busy(cache)) { in wait_for_cache()
59 static inline int _cache_all(NRF_CACHE_Type *cache, enum k_nrf_cache_op op) in _cache_all() argument
68 wait_for_cache(cache); in _cache_all()
74 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_CLEANCACHE); in _cache_all()
79 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_INVALIDATECACHE); in _cache_all()
84 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_FLUSHCACHE); in _cache_all()
92 wait_for_cache(cache); in _cache_all()
97 static inline void _cache_line(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, uintptr_t line_addr) in _cache_line() argument
100 wait_for_cache(cache); in _cache_line()
102 nrf_cache_lineaddr_set(cache, line_addr); in _cache_line()
108 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_CLEANLINE); in _cache_line()
113 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_INVALIDATELINE); in _cache_line()
118 nrf_cache_task_trigger(cache, NRF_CACHE_TASK_FLUSHLINE); in _cache_line()
125 } while (nrf_cache_lineaddr_get(cache) != line_addr); in _cache_line()
128 static inline int _cache_range(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, void *addr, in _cache_range() argument
150 _cache_line(cache, op, line_addr); in _cache_range()
154 wait_for_cache(cache); in _cache_range()
159 static inline int _cache_checks(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, void *addr, in _cache_checks() argument
163 if (!(cache->ENABLE & CACHE_ENABLE_ENABLE_Enabled)) { in _cache_checks()
168 return _cache_all(cache, op); in _cache_checks()
176 return _cache_range(cache, op, addr, size); in _cache_checks()