| ... | @@ -146,10 +146,12 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void { | ... | @@ -146,10 +146,12 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void { |
| 146 | //for (uintptr_t dword = start_dword; dword < end_dword; dword += dword_size) | 146 | //for (uintptr_t dword = start_dword; dword < end_dword; dword += dword_size) |
| 147 | // __asm__ volatile("flush %0" : : "r"(dword)); | 147 | // __asm__ volatile("flush %0" : : "r"(dword)); |
| 148 | } else if (apple) { | 148 | } else if (apple) { |
| 149 | @compileError("TODO"); | 149 | // On Darwin, sys_icache_invalidate() provides this functionality |
| 150 | //// On Darwin, sys_icache_invalidate() provides this functionality | 150 | sys_icache_invalidate(start, end - start); |
| 151 | //sys_icache_invalidate(start, end - start); | | |
| 152 | } else { | 151 | } else { |
| 153 | @compileError("no __clear_cache implementation available for this target"); | 152 | @compileError("no __clear_cache implementation available for this target"); |
| 154 | } | 153 | } |
| 155 | } | 154 | } |
| | 155 | |
| | 156 | // Darwin-only |
| | 157 | extern fn sys_icache_invalidate(start: usize, len: usize) void; |