diff mbox series

[PULL,03/17] util/cacheflush: Use declarations from <OSCacheControl.h> on Darwin

Message ID 20230613093822.63750-4-philmd@linaro.org
State Accepted
Commit 0baf54d0056979d6344b872a5b20acb6a5fd3cf8
Headers show
Series [PULL,01/17] linux-user, bsd-user: Preserve incoming order of environment variables in the target | expand

Commit Message

Philippe Mathieu-Daudé June 13, 2023, 9:38 a.m. UTC
Per the cache(3) man page, sys_icache_invalidate() and
sys_dcache_flush() are declared in <libkern/OSCacheControl.h>.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230605175647.88395-2-philmd@linaro.org>
---
 util/cacheflush.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/util/cacheflush.c b/util/cacheflush.c
index 06c2333a60..de35616718 100644
--- a/util/cacheflush.c
+++ b/util/cacheflush.c
@@ -237,8 +237,8 @@  static void __attribute__((constructor)) init_cache_info(void)
 
 #ifdef CONFIG_DARWIN
 /* Apple does not expose CTR_EL0, so we must use system interfaces. */
-extern void sys_icache_invalidate(void *start, size_t len);
-extern void sys_dcache_flush(void *start, size_t len);
+#include <libkern/OSCacheControl.h>
+
 void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
 {
     sys_dcache_flush((void *)rw, len);