commit 39589cffe0bfcfda8d4802cc14fc335f532a7a90 (tree)
parent 03013e517689575e6050c5c950f6d19847302b85
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 24 Mar 2020 11:51:13 -0400
compiler-rt: fix __clear_cache on aarch64 darwin
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git 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;