orc: fix cache flush for iOS
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Thu, 25 Apr 2013 15:09:22 +0000 (17:09 +0200)
committerAndoni Morales Alastruey <ylatuya@gmail.com>
Thu, 25 Apr 2013 15:14:32 +0000 (17:14 +0200)
Apple does not provide an implementation of __clear_cache in ARM
but sys_icache_invalidate can be used instead

review-by: Sebastian Dröge

orc/orcarm.c

index d66e55f..3622ac3 100644 (file)
 #include <orc/orcarm.h>
 #include <orc/orcutils.h>
 
+#ifdef HAVE_ARM
+#if defined(__APPLE__)
+#include  <libkern/OSCacheControl.h>
+#endif
+#endif
+
 /**
  * SECTION:orcarm
  * @title: ARM
@@ -724,8 +730,12 @@ void
 orc_arm_flush_cache (OrcCode *code)
 {
 #ifdef HAVE_ARM
+#ifdef __APPLE__
+  sys_icache_invalidate(code->code, code->code_size);
+#else
   __clear_cache (code->code, code->code + code->code_size);
 #endif
+#endif
 }
 
 void