Update <sys/cachectl.h>.
NDK API review complained about missing nullability annotations (added),
not having a `__riscv` #if guard around this function (added), and not
using `__INTRODUCED_IN(35)`. I haven't done the last of these because
that seems less helpful than the traditional "nothing" meaning "always
available" (since this riscv64-only function will be available from
whatever the first riscv64 API level ends up being).
Bug: http://b/291777120
Test: treehugger
Change-Id: I501b42851bd5b1612244bd86351628d249a57b99
diff --git a/libc/include/sys/cachectl.h b/libc/include/sys/cachectl.h
index fd775ee..b5fabe3 100644
--- a/libc/include/sys/cachectl.h
+++ b/libc/include/sys/cachectl.h
@@ -37,6 +37,8 @@
__BEGIN_DECLS
+#if defined(__riscv)
+
/**
* Flag for __riscv_flush_icache() to indicate that only the current
* thread's instruction cache needs to be flushed (rather than the
@@ -46,9 +48,12 @@
/**
* __riscv_flush_icache(2) flushes the instruction cache for the given range of addresses.
+ * The address range is currently (Linux 6.4) ignored, so both pointers may be null.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int __riscv_flush_icache(void* __start, void* __end, unsigned long __flags);
+int __riscv_flush_icache(void* _Nullable __start, void* _Nullable __end, unsigned long __flags);
+
+#endif
__END_DECLS