1 .\" Written by Ralf Baechle (ralf@waldorf-gmbh.de),
2 .\" Copyright (c) 1994, 1995 Waldorf GMBH
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .TH CACHEFLUSH 2 2017-09-15 "Linux" "Linux Programmer's Manual"
27 cacheflush \- flush contents of instruction and/or data cache
30 .B #include <asm/cachectl.h>
32 .BI "int cacheflush(char *" addr ", int "nbytes ", int "cache );
36 flushes the contents of the indicated cache(s) for the
37 user addresses in the range
45 Flush the instruction cache.
48 Write back to memory and invalidate the affected valid cache lines.
55 returns 0 on success or \-1 on error.
56 If errors are detected,
58 will indicate the error.
62 Some or all of the address range
77 Historically, this system call was available on all MIPS UNIX variants
78 including RISC/os, IRIX, Ultrix, NetBSD, OpenBSD, and FreeBSD
79 (and also on some non-UNIX MIPS operating systems), so that
80 the existence of this call in MIPS operating systems is a de-facto
84 should not be used in programs intended to be portable.
85 On Linux, this call first appeared on the MIPS architecture,
86 but nowadays, Linux provides a
88 system call on some other architectures, but with different arguments.
90 Linux kernels older than version 2.6.11 ignore the
94 arguments, making this function fairly expensive.
95 Therefore, the whole cache is always flushed.
97 This function always behaves as if
99 has been passed for the
101 argument and does not do any error checking on the