From 39589cffe0bfcfda8d4802cc14fc335f532a7a90 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 24 Mar 2020 11:51:13 -0400 Subject: compiler-rt: fix __clear_cache on aarch64 darwin --- lib/std/special/compiler_rt/clear_cache.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/std') diff --git a/lib/std/special/compiler_rt/clear_cache.zig b/lib/std/special/compiler_rt/clear_cache.zig index 740de34749..77470251d1 100644 --- a/lib/std/special/compiler_rt/clear_cache.zig +++ b/lib/std/special/compiler_rt/clear_cache.zig @@ -146,10 +146,12 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void { //for (uintptr_t dword = start_dword; dword < end_dword; dword += dword_size) // __asm__ volatile("flush %0" : : "r"(dword)); } else if (apple) { - @compileError("TODO"); - //// On Darwin, sys_icache_invalidate() provides this functionality - //sys_icache_invalidate(start, end - start); + // On Darwin, sys_icache_invalidate() provides this functionality + sys_icache_invalidate(start, end - start); } else { @compileError("no __clear_cache implementation available for this target"); } } + +// Darwin-only +extern fn sys_icache_invalidate(start: usize, len: usize) void; -- cgit v1.2.3