Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cache.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Carlo Caione <ccaione@baylibre.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_ARCH_CACHE_H_
13#define ZEPHYR_INCLUDE_ARCH_CACHE_H_
14
22#if defined(CONFIG_ARM64)
24#elif defined(CONFIG_XTENSA)
26#endif
27
28#if defined(CONFIG_DCACHE)
29
35extern void arch_dcache_enable(void);
36
37#define cache_data_enable arch_dcache_enable
38
44extern void arch_dcache_disable(void);
45
46#define cache_data_disable arch_dcache_disable
47
57extern int arch_dcache_flush_all(void);
58
59#define cache_data_flush_all arch_dcache_flush_all
60
70extern int arch_dcache_invd_all(void);
71
72#define cache_data_invd_all arch_dcache_invd_all
73
83extern int arch_dcache_flush_and_invd_all(void);
84
85#define cache_data_flush_and_invd_all arch_dcache_flush_and_invd_all
86
106extern int arch_dcache_flush_range(void *addr, size_t size);
107
108#define cache_data_flush_range(addr, size) arch_dcache_flush_range(addr, size)
109
130extern int arch_dcache_invd_range(void *addr, size_t size);
131
132#define cache_data_invd_range(addr, size) arch_dcache_invd_range(addr, size)
133
155extern int arch_dcache_flush_and_invd_range(void *addr, size_t size);
156
157#define cache_data_flush_and_invd_range(addr, size) \
158 arch_dcache_flush_and_invd_range(addr, size)
159
160#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
161
175extern size_t arch_dcache_line_size_get(void);
176
177#define cache_data_line_size_get arch_dcache_line_size_get
178
179#endif /* CONFIG_DCACHE_LINE_SIZE_DETECT */
180
181#endif /* CONFIG_DCACHE */
182
183#if defined(CONFIG_ICACHE)
184
190extern void arch_icache_enable(void);
191
192#define cache_instr_enable arch_icache_enable
193
199extern void arch_icache_disable(void);
200
201#define cache_instr_disable arch_icache_disable
202
212extern int arch_icache_flush_all(void);
213
214#define cache_instr_flush_all arch_icache_flush_all
215
225extern int arch_icache_invd_all(void);
226
227#define cache_instr_invd_all arch_icache_invd_all
228
238extern int arch_icache_flush_and_invd_all(void);
239
240#define cache_instr_flush_and_invd_all arch_icache_flush_and_invd_all
241
261extern int arch_icache_flush_range(void *addr, size_t size);
262
263#define cache_instr_flush_range(addr, size) arch_icache_flush_range(addr, size)
264
285extern int arch_icache_invd_range(void *addr, size_t size);
286
287#define cache_instr_invd_range(addr, size) arch_icache_invd_range(addr, size)
288
309extern int arch_icache_flush_and_invd_range(void *addr, size_t size);
310
311#define cache_instr_flush_and_invd_range(addr, size) \
312 arch_icache_flush_and_invd_range(addr, size)
313
314#if defined(CONFIG_ICACHE_LINE_SIZE_DETECT)
315
330extern size_t arch_icache_line_size_get(void);
331
332#define cache_instr_line_size_get arch_icache_line_size_get
333
334#endif /* CONFIG_ICACHE_LINE_SIZE_DETECT */
335
336#endif /* CONFIG_ICACHE */
337
342#endif /* ZEPHYR_INCLUDE_ARCH_CACHE_H_ */