From 811d4cf4b08ba141b7f9c3481c5ab50d47123499 Mon Sep 17 00:00:00 2001 From: balrog Date: Mon, 19 May 2008 23:59:38 +0000 Subject: ARM host support for TCG targets. Updated from previous version to use the tcg prologue/epilogue mechanism, may be slower than direct call. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4500 c046a42c-6fe2-441c-8c8c-71466251a162 --- exec-all.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'exec-all.h') diff --git a/exec-all.h b/exec-all.h index d8c6c3371e..51b27b5141 100644 --- a/exec-all.h +++ b/exec-all.h @@ -142,7 +142,7 @@ static inline int tlb_set_page(CPUState *env1, target_ulong vaddr, #define CODE_GEN_MAX_BLOCKS (CODE_GEN_BUFFER_SIZE / CODE_GEN_AVG_BLOCK_SIZE) -#if defined(__powerpc__) || defined(__x86_64__) +#if defined(__powerpc__) || defined(__x86_64__) || defined(__arm__) #define USE_DIRECT_JUMP #endif #if defined(__i386__) && !defined(_WIN32) @@ -240,6 +240,22 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr *(uint32_t *)jmp_addr = addr - (jmp_addr + 4); /* no need to flush icache explicitely */ } +#elif defined(__arm__) +static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr) +{ + register unsigned long _beg __asm ("a1"); + register unsigned long _end __asm ("a2"); + register unsigned long _flg __asm ("a3"); + + /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */ + *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff; + + /* flush icache */ + _beg = jmp_addr; + _end = jmp_addr + 4; + _flg = 0; + __asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg)); +} #endif static inline void tb_set_jmp_target(TranslationBlock *tb, -- cgit v1.2.3-55-g7522