8#ifndef ZEPHYR_INCLUDE_CACHE_H_
9#define ZEPHYR_INCLUDE_CACHE_H_
24#if defined(CONFIG_EXTERNAL_CACHE)
27#elif defined(CONFIG_ARCH_CACHE)
46#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
59#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
72#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
85#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
101#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
118#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
135#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
152#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
169#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
186#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
213static ALWAYS_INLINE int z_impl_sys_cache_data_flush_range(
void *addr,
size_t size)
215#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
245#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
276static ALWAYS_INLINE int z_impl_sys_cache_data_invd_range(
void *addr,
size_t size)
278#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
309#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
340static ALWAYS_INLINE int z_impl_sys_cache_data_flush_and_invd_range(
void *addr,
size_t size)
342#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
373#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_ICACHE)
399#ifdef CONFIG_DCACHE_LINE_SIZE_DETECT
401#elif defined(CONFIG_DCACHE_LINE_SIZE)
402 return CONFIG_DCACHE_LINE_SIZE;
425#ifdef CONFIG_ICACHE_LINE_SIZE_DETECT
427#elif defined(CONFIG_ICACHE_LINE_SIZE)
428 return CONFIG_ICACHE_LINE_SIZE;
449#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_CACHE_DOUBLEMAP)
473#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_CACHE_DOUBLEMAP)
502#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_CACHE_DOUBLEMAP)
505 return (__sparse_force
void __sparse_cache *)ptr;
527#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_CACHE_DOUBLEMAP)
530 return (__sparse_force
void *)ptr;
535#ifdef CONFIG_LIBMETAL
536static ALWAYS_INLINE void sys_cache_flush(
void *addr,
size_t size)
542#include <zephyr/syscalls/cache.h>
Public APIs for architectural cache controller drivers.
Main header file for external cache controller driver API.
#define cache_uncached_ptr(ptr)
Definition cache.h:348
#define cache_instr_invd_all
Definition cache.h:226
#define cache_cached_ptr(ptr)
Definition cache.h:345
#define cache_instr_disable
Definition cache.h:200
#define cache_is_ptr_uncached(ptr)
Definition cache.h:342
#define cache_instr_flush_all
Definition cache.h:213
#define cache_data_flush_and_invd_range(addr, size)
Definition cache.h:156
#define cache_instr_invd_range(addr, size)
Definition cache.h:286
#define cache_instr_flush_and_invd_all
Definition cache.h:239
#define cache_instr_enable
Definition cache.h:191
#define cache_instr_flush_range(addr, size)
Definition cache.h:262
#define cache_data_invd_range(addr, size)
Definition cache.h:131
#define cache_instr_flush_and_invd_range(addr, size)
Definition cache.h:310
#define cache_data_invd_all
Definition cache.h:71
#define cache_is_ptr_cached(ptr)
Definition cache.h:339
#define cache_data_flush_range(addr, size)
Definition cache.h:107
#define cache_data_flush_and_invd_all
Definition cache.h:84
#define cache_data_flush_all
Definition cache.h:58
#define cache_data_enable
Definition cache.h:36
#define cache_instr_line_size_get
Definition cache.h:331
#define cache_data_disable
Definition cache.h:45
#define cache_data_line_size_get
Definition cache.h:176
static ALWAYS_INLINE bool sys_cache_is_ptr_cached(void *ptr)
Test if a pointer is in cached region.
Definition cache.h:447
static ALWAYS_INLINE void * sys_cache_uncached_ptr_get(void *ptr)
Return uncached pointer to a RAM address.
Definition cache.h:525
static ALWAYS_INLINE int sys_cache_data_flush_all(void)
Flush the d-cache.
Definition cache.h:99
static ALWAYS_INLINE int sys_cache_instr_flush_and_invd_all(void)
Flush and Invalidate the i-cache.
Definition cache.h:184
static ALWAYS_INLINE size_t sys_cache_instr_line_size_get(void)
Get the i-cache line size.
Definition cache.h:423
static ALWAYS_INLINE void sys_cache_instr_disable(void)
Disable the i-cache.
Definition cache.h:83
int sys_cache_data_flush_and_invd_range(void *addr, size_t size)
Flush and Invalidate an address range in the d-cache.
int sys_cache_data_invd_range(void *addr, size_t size)
Invalidate an address range in the d-cache.
static ALWAYS_INLINE int sys_cache_instr_flush_range(void *addr, size_t size)
Flush an address range in the i-cache.
Definition cache.h:243
static ALWAYS_INLINE int sys_cache_instr_flush_all(void)
Flush the i-cache.
Definition cache.h:116
static ALWAYS_INLINE size_t sys_cache_data_line_size_get(void)
Get the d-cache line size.
Definition cache.h:397
int sys_cache_data_flush_range(void *addr, size_t size)
Flush an address range in the d-cache.
static ALWAYS_INLINE int sys_cache_instr_flush_and_invd_range(void *addr, size_t size)
Flush and Invalidate an address range in the i-cache.
Definition cache.h:371
static ALWAYS_INLINE void * sys_cache_cached_ptr_get(void *ptr)
Return cached pointer to a RAM address.
Definition cache.h:500
static ALWAYS_INLINE void sys_cache_data_disable(void)
Disable the d-cache.
Definition cache.h:57
static ALWAYS_INLINE int sys_cache_instr_invd_range(void *addr, size_t size)
Invalidate an address range in the i-cache.
Definition cache.h:307
static ALWAYS_INLINE void sys_cache_data_enable(void)
Enable the d-cache.
Definition cache.h:44
static ALWAYS_INLINE void sys_cache_instr_enable(void)
Enable the i-cache.
Definition cache.h:70
static ALWAYS_INLINE int sys_cache_data_invd_all(void)
Invalidate the d-cache.
Definition cache.h:133
static ALWAYS_INLINE bool sys_cache_is_ptr_uncached(void *ptr)
Test if a pointer is in un-cached region.
Definition cache.h:471
static ALWAYS_INLINE int sys_cache_data_flush_and_invd_all(void)
Flush and Invalidate the d-cache.
Definition cache.h:167
static ALWAYS_INLINE int sys_cache_instr_invd_all(void)
Invalidate the i-cache.
Definition cache.h:150
#define ENOTSUP
Unsupported value.
Definition errno.h:114