coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cache.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * cache.h: Cache maintenance API for ARM64
4  */
5 
6 #ifndef ARM_ARM64_CACHE_H
7 #define ARM_ARM64_CACHE_H
8 
9 #include <arch/lib_helpers.h>
10 
11 #ifndef __ASSEMBLER__
12 
13 #include <stddef.h>
14 #include <arch/barrier.h>
15 
16 /* dcache clean by virtual address to PoC */
17 void dcache_clean_by_mva(void const *addr, size_t len);
18 
19 /* dcache clean and invalidate by virtual address to PoC */
20 void dcache_clean_invalidate_by_mva(void const *addr, size_t len);
21 
22 /* dcache invalidate by virtual address to PoC */
23 void dcache_invalidate_by_mva(void const *addr, size_t len);
24 
25 /* dcache clean and/or invalidate all sets/ways to PoC */
26 void dcache_clean_all(void);
27 void dcache_invalidate_all(void);
29 
30 /* returns number of bytes per cache line */
31 unsigned int dcache_line_bytes(void);
32 
33 /* Invalidate all TLB entries. */
34 static inline void tlb_invalidate_all(void)
35 {
36  /* TLBIALL includes dTLB and iTLB on systems that have them. */
37  tlbiall_el3();
38  dsb();
39  isb();
40 }
41 
42 /* Invalidate all of the instruction cache for PE to PoU. */
43 static inline void icache_invalidate_all(void)
44 {
45  dsb();
46  iciallu();
47  dsb();
48  isb();
49 }
50 
51 #endif /* __ASSEMBLER__ */
52 
53 #endif /* ARM_ARM64_CACHE_H */
static void icache_invalidate_all(void)
Definition: cache.h:43
void dcache_invalidate_all(void)
Definition: cache.c:22
void dcache_invalidate_by_mva(void const *addr, size_t len)
Definition: cache.c:45
void dcache_clean_all(void)
Definition: cache.c:14
void dcache_clean_by_mva(void const *addr, size_t len)
Definition: cache.c:37
void dcache_clean_invalidate_by_mva(void const *addr, size_t len)
Definition: cache.c:41
unsigned int dcache_line_bytes(void)
Definition: cache.c:26
void dcache_clean_invalidate_all(void)
Definition: cache.c:18
void tlb_invalidate_all(void)
Definition: cache.c:10
static void dsb(void)
Definition: cache.h:54
static void isb(void)
Definition: cache.h:60
static void iciallu(void)
Definition: cache.h:177
static u32 addr
Definition: cirrus.c:14
static void tlbiall_el3(void)
Definition: lib_helpers.h:315