[pushed] Darwin, X86 : Implement __cache_clear.

Iain Sandoe iain@sandoe.co.uk
Fri Aug 27 16:08:33 GMT 2021


Hi,

We had a NOP cache clear, but there is a suitable mechanism provided
by a system call.  This connects it up.

tested on i686, x86_64-darwin and x86_64-linux
pushed to master, thanks
Iain

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/i386/darwin.h (CLEAR_INSN_CACHE): New.
---
 gcc/config/i386/darwin.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 73b06e2307d..da0ae5b3ee7 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -344,3 +344,8 @@ along with GCC; see the file COPYING3.  If not see
 #undef SUBTARGET_SHADOW_OFFSET
 #define SUBTARGET_SHADOW_OFFSET	\
   (TARGET_LP64 ? HOST_WIDE_INT_1 << 44 : HOST_WIDE_INT_1 << 29)
+
+#undef CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(beg, end)				\
+  extern void sys_icache_invalidate(void *start, size_t len);	\
+  sys_icache_invalidate ((beg), (size_t)((end)-(beg)))
-- 
2.24.3 (Apple Git-128)




More information about the Gcc-patches mailing list