OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[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 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, write to the Free
21 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22 .\" USA.
23 .\"
24 .TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual"
25 .SH NAME
26 cacheflush \- flush contents of instruction and/or data cache
27 .SH SYNOPSIS
28 .nf
29 .B #include <asm/cachectl.h>
30 .sp
31 .BI "int cacheflush(char *" addr ", int "nbytes ", int "cache );
32 .fi
33 .SH DESCRIPTION
34 .BR cacheflush ()
35 flushes the contents of the indicated cache(s) for the
36 user addresses in the range
37 .I addr
38 to
39 .IR (addr+nbytes-1) .
40 .I cache
41 may be one of:
42 .TP
43 .B ICACHE
44 Flush the instruction cache.
45 .TP
46 .B DCACHE
47 Write back to memory and invalidate the affected valid cache lines.
48 .TP
49 .B BCACHE
50 Same as
51 .BR (ICACHE|DCACHE) .
52 .SH "RETURN VALUE"
53 .BR cacheflush ()
54 returns 0 on success or \-1 on error.
55 If errors are detected,
56 .I errno
57 will indicate the error.
58 .SH ERRORS
59 .TP
60 .B EFAULT
61 Some or all of the address range
62 .I addr
63 to
64 .I (addr+nbytes-1)
65 is not accessible.
66 .TP
67 .B EINVAL
68 .I cache
69 is not one of
70 .BR ICACHE ,
71 .BR DCACHE ,
72 or
73 .BR BCACHE .
74 .SH CONFORMING TO
75 This Linux-specific system call is only available on MIPS-based systems.
76 .\" FIXME This system call was only on MIPS back in 1.2 days, but
77 .\" by now it is on a number of other architectures (but not i386).
78 .\" Investigate the details and update this page.
79 It should not be used in programs intended to be portable.
80 .\" Irix 6.5 appears to have a cacheflush() syscall -- mtk
81 .SH BUGS
82 The current implementation ignores the
83 .I addr
84 and
85 .I nbytes
86 arguments.
87 Therefore, the whole cache is always flushed.