---
name: "riscv_flush_icache"
section: "2"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__riscv_flush_icache"
---

# riscv\_flush\_icache(2)

Flush icaches on RISC-V

Part of [\_\_riscv\_flush\_icache(3)](/__riscv_flush_icache/3.md).

## NAME

\_\_riscv\_flush\_icache - Flush icaches on RISC-V

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <sys/cachectl.h>
```

**int \_\_riscv\_flush\_icache(void \*start, void \*end, unsigned long flags);**

## DESCRIPTION

**\_\_riscv\_flush\_icache**() enforces ordering between stores and instruction cache fetches.

The range of addresses over which ordering is enforced is specified by *start* and *end*.

The *flags* argument controls the extent of this ordering, with the default behavior (a *flags* value of 0) being to enforce the fence on all threads in the current process. Setting the **SYS\_RISCV\_FLUSH\_ICACHE\_LOCAL** bit allows users to indicate that enforcing ordering on only the current thread is necessary. All other bits in *flags* are reserved.

## STANDARDS

Linux on RISC-V.

## HISTORY

Linux 4.15. glibc 2.27.

## SEE ALSO

[**syscall**(2)](/syscall/2.md)
