diff mbox series

[04/17] Add documentation for __riscv_flush_icache

Message ID 20180125043621.19972-5-palmer@dabbelt.com
State New
Headers show
Series [01/17] Skeleton documentation for the RISC-V port | expand

Commit Message

Palmer Dabbelt Jan. 25, 2018, 4:36 a.m. UTC
I don't know if this is actually the right place to put this: it's a
Linux-specific function, and while users can call it we'd really prefer
they use rely on GCC to emit it when necessary from via its cache
flushing intrinsics.

2018-01-13  Palmer Dabbelt  <palmer@sifive.com>

        * manual/platform.texi: Add RISC-V documenation for
        __riscv_flush_icache.
---
 manual/platform.texi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/manual/platform.texi b/manual/platform.texi
index cb166641fb71..b8721a071272 100644
--- a/manual/platform.texi
+++ b/manual/platform.texi
@@ -6,6 +6,7 @@ 
 
 @menu
 * PowerPC::           Facilities Specific to the PowerPC Architecture
+* RISC-V::            Facilities Specific to the RISC-V Architecture
 @end menu
 
 @node PowerPC
@@ -115,3 +116,21 @@  problem-state programs.  If the program priority is medium high when the time
 interval expires or if an attempt is made to set the priority to medium high
 when it is not allowed, the priority is set to medium.
 @end deftypefun
+
+@node RISC-V
+@appendixsec RISC-V-specific Facilities
+
+Cache management facilities specific to RISC-V systems that implement the Linux
+ABI are declared in @file{sys/cachectl.h}.
+
+@deftypefun {void} __riscv_flush_icache(void *@var{start}, void *@var{end}, unsigned long int @var{flags})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+Enforce ordering between stores and instruction cache fetches.  The range of
+addresses over which ordering is enforced is specified by @var{start} and
+@var{end}.  The @var{flags} argument controls the extent of this ordering, with
+the default behavior (a @var{flags} value of 0) being to enforce the fence on
+all threads in the current process.  Setting the
+@code{SYS_RISCV_FLUSH_ICACHE_LOCAL} bit allows users to indicate that enforcing
+ordering on only the current thread is necessary.  All other flag bits are
+reserved.
+@end deftypefun