From 9ed1ffff3559afb4afefe89d08d3b7adf94cd431 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 31 Jan 2011 15:39:59 -0700 Subject: [PATCH] implement syncInstructionCache for ARM Like, PowerPC, ARM has an instruction cache which must be manually flushed if/when we compile a new method. This commit updates syncInstructionCache to use GCC's builtin __clear_cache routine. --- src/arm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/arm.h b/src/arm.h index e66377e7f6..c2e933a1b0 100644 --- a/src/arm.h +++ b/src/arm.h @@ -55,9 +55,11 @@ loadMemoryBarrier() } inline void -syncInstructionCache(const void* start UNUSED, unsigned size UNUSED) +syncInstructionCache(const void* start, unsigned size) { - asm("nop"); + __clear_cache + (const_cast(start), + const_cast(static_cast(start) + size)); } typedef int (__kernel_cmpxchg_t)(int oldval, int newval, int *ptr);