| 1 |
.\" Copyright 2024, Rivos, Inc. |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
.\" |
| 6 |
.TH __riscv_flush_icache 3 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
__riscv_flush_icache |
| 9 |
\- |
| 10 |
Flush icaches on RISC-V |
| 11 |
.SH LIBRARY |
| 12 |
Standard C library |
| 13 |
.RI ( libc ,\~ \-lc ) |
| 14 |
.SH SYNOPSIS |
| 15 |
.nf |
| 16 |
.B #include <sys/cachectl.h> |
| 17 |
.P |
| 18 |
.B int __riscv_flush_icache(void *start, void *end, \ |
| 19 |
unsigned long flags); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
.BR __riscv_flush_icache () |
| 23 |
enforces ordering between stores and instruction cache fetches. |
| 24 |
.P |
| 25 |
The range of addresses over which ordering is enforced is specified by |
| 26 |
.I start |
| 27 |
and |
| 28 |
.IR end . |
| 29 |
.P |
| 30 |
The |
| 31 |
.I flags |
| 32 |
argument controls the extent of this ordering, |
| 33 |
with the default behavior |
| 34 |
(a |
| 35 |
.I flags |
| 36 |
value of 0) |
| 37 |
being to enforce the fence on |
| 38 |
all threads in the current process. |
| 39 |
Setting the |
| 40 |
.B SYS_RISCV_FLUSH_ICACHE_LOCAL |
| 41 |
bit allows users to indicate that enforcing ordering on |
| 42 |
only the current thread is necessary. |
| 43 |
All other bits in |
| 44 |
.I flags |
| 45 |
are reserved. |
| 46 |
.SH STANDARDS |
| 47 |
Linux on RISC-V. |
| 48 |
.SH HISTORY |
| 49 |
Linux 4.15. |
| 50 |
glibc 2.27. |
| 51 |
.SH SEE ALSO |
| 52 |
.BR syscall (2) |