Re: [PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more portable alternative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/14/20 12:43 PM, Alejandro Colomar wrote:
Reported-by: Heinrich Schuchardt <xypron.glpk@xxxxxx>
Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@xxxxxx>

---
  man2/cacheflush.2 | 24 ++++++++++++++++++++++++
  1 file changed, 24 insertions(+)

diff --git a/man2/cacheflush.2 b/man2/cacheflush.2
index aba625721..7a2eed506 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 :
+Until GCC 9.1.0,
+the prototype for this built-in function used
+.I char *
+instead of
+.I void *
+for the parameters.
  .SH BUGS
  Linux kernels older than version 2.6.11 ignore the
  .I addr






[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux