diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2020-12-15 14:30:20 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-12-20 21:47:43 +0100 |
| commit | d7e7ab0e3471b92c824e270a1361c84a03ab9f69 (patch) | |
| tree | c81619e407d8266c64bbe4ac8ddf5afa23d54e7b /man2/cacheflush.2 | |
| parent | ce0efb43824d20a30f9f64c1921d8493a201df5b (diff) | |
| download | man-pages-d7e7ab0e3471b92c824e270a1361c84a03ab9f69.tar.gz | |
cacheflush.2: Document __builtin___clear_cache() as a more portable alternative
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Martin Sebor <msebor@redhat.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man2/cacheflush.2')
| -rw-r--r-- | man2/cacheflush.2 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/man2/cacheflush.2 b/man2/cacheflush.2 index aba625721b..0701017e78 100644 --- a/man2/cacheflush.2 +++ b/man2/cacheflush.2 @@ -86,6 +86,30 @@ On Linux, this call first appeared on the MIPS architecture, but nowadays, Linux provides a .BR cacheflush () system call on some other architectures, but with different arguments. +.SH NOTES +Unless you need the finer grained control that this system call provides, +you probably want to use the GCC built-in function +.BR __builtin___clear_cache (), +which provides a portable interface +across platforms supported by GCC and compatible compilers: +.PP +.in +4n +.EX +.BI "void __builtin___clear_cache(void *" begin ", void *" end ); +.EE +.in +.PP +On platforms that don't require instruction cache flushes, +.BR __builtin___clear_cache () +has no effect. +.PP +.IR Note : +On some GCC-compatible compilers, +the prototype for this built-in function uses +.I char * +instead of +.I void * +for the parameters. .SH BUGS Linux kernels older than version 2.6.11 ignore the .I addr |
