1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Local cache operations.
pub use flush_icache_all;
/// Completes data-side preparation for subsequent local instruction synchronization.
/// This architecture needs no separate data-cache clean for coherent CPU stores;
/// callers must still perform `flush_icache_all` before executing modified text.
///
/// # Safety
/// The range must remain mapped; the caller coordinates concurrent text writes
/// and execution, including the subsequent instruction synchronization.
pub unsafe
/// Writes back and invalidates data-cache lines intersecting the byte range.
///
/// The supported LoongArch cache geometry uses 64-byte lines. The starting
/// address is rounded down; completion includes a full `dbar 0` barrier.
/// An empty range performs no cache operation.
///
/// # Safety
/// The caller must own the cache lines covering the range, keep them mapped,
/// and exclude conflicting CPU/device writes until completion. The range must
/// not wrap the virtual address space.
pub unsafe