OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man2 / cacheflush.2
1 .\" Written by Ralf Baechle (ralf@waldorf-gmbh.de),
2 .\" Copyright (c) 1994, 1995 Waldorf GMBH
3 .\"
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.
9 .\"
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.
14 .\"
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.
19 .\"
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/>.
23 .\" %%%LICENSE_END
24 .\"
25 .TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 cacheflush \- flush contents of instruction and/or data cache
28 .SH SYNOPSIS
29 .nf
30 .B #include <asm/cachectl.h>
31 .sp
32 .BI "int cacheflush(char *" addr ", int "nbytes ", int "cache );
33 .fi
34 .SH DESCRIPTION
35 .BR cacheflush ()
36 flushes the contents of the indicated cache(s) for the
37 user addresses in the range
38 .I addr
39 to
40 .IR (addr+nbytes-1) .
41 .I cache
42 may be one of:
43 .TP
44 .B ICACHE
45 Flush the instruction cache.
46 .TP
47 .B DCACHE
48 Write back to memory and invalidate the affected valid cache lines.
49 .TP
50 .B BCACHE
51 Same as
52 .BR (ICACHE|DCACHE) .
53 .SH RETURN VALUE
54 .BR cacheflush ()
55 returns 0 on success or \-1 on error.
56 If errors are detected,
57 .I errno
58 will indicate the error.
59 .SH ERRORS
60 .TP
61 .B EFAULT
62 Some or all of the address range
63 .I addr
64 to
65 .I (addr+nbytes-1)
66 is not accessible.
67 .TP
68 .B EINVAL
69 .I cache
70 is not one of
71 .BR ICACHE ,
72 .BR DCACHE ,
73 or
74 .BR BCACHE .
75 .SH CONFORMING TO
76 This Linux-specific system call is available only on MIPS-based systems.
77 .\" FIXME This system call was only on MIPS back in 1.2 days, but
78 .\" by now it is on a number of other architectures (but not i386).
79 .\" Investigate the details and update this page.
80 It should not be used in programs intended to be portable.
81 .\" Irix 6.5 appears to have a cacheflush() syscall -- mtk
82 .SH BUGS
83 The current implementation ignores the
84 .I addr
85 and
86 .I nbytes
87 arguments.
88 Therefore, the whole cache is always flushed.
89 .SH COLOPHON
90 This page is part of release 3.68 of the Linux
91 .I man-pages
92 project.
93 A description of the project,
94 information about reporting bugs,
95 and the latest version of this page,
96 can be found at
97 \%http://www.kernel.org/doc/man\-pages/.