From: João Matos Date: Wed, 14 Oct 2015 16:50:00 +0000 (+0100) Subject: [runtime] Simplify ARM mono_arch_flush_icache. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=3219392b92865c36677c78469d0749fa8e27ed63;p=mono.git [runtime] Simplify ARM mono_arch_flush_icache. We do not support compiling with older versions of GCC anymore so most of this should be just dead code. --- diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index bb146818986..529b80a7abd 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -1173,47 +1173,17 @@ mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv) #endif /* #ifndef DISABLE_JIT */ -#ifndef __GNUC_PREREQ -#define __GNUC_PREREQ(maj, min) (0) -#endif - void mono_arch_flush_icache (guint8 *code, gint size) { -#if defined(__native_client__) +#if defined(MONO_CROSS_COMPILE) || defined(__native_client__) // For Native Client we don't have to flush i-cache here, // as it's being done by dyncode interface. -#else - -#ifdef MONO_CROSS_COMPILE #elif __APPLE__ sys_icache_invalidate (code, size); -#elif __GNUC_PREREQ(4, 3) - __builtin___clear_cache (code, code + size); -#elif __GNUC_PREREQ(4, 1) - __clear_cache (code, code + size); -#elif defined(PLATFORM_ANDROID) - const int syscall = 0xf0002; - __asm __volatile ( - "mov r0, %0\n" - "mov r1, %1\n" - "mov r7, %2\n" - "mov r2, #0x0\n" - "svc 0x00000000\n" - : - : "r" (code), "r" (code + size), "r" (syscall) - : "r0", "r1", "r7", "r2" - ); #else - __asm __volatile ("mov r0, %0\n" - "mov r1, %1\n" - "mov r2, %2\n" - "swi 0x9f0002 @ sys_cacheflush" - : /* no outputs */ - : "r" (code), "r" (code + size), "r" (0) - : "r0", "r1", "r3" ); + __builtin___clear_cache (code, code + size); #endif -#endif /* !__native_client__ */ } typedef enum {