aboutsummaryrefslogtreecommitdiff
path: root/tcg/arm/tcg-target.h
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 02:02:37 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 02:02:37 +0000
commit3233f0d463d299be89e2672928fc215dc99c2c71 (patch)
treedac89efe98e8fab634570c25683c519e453e2daf /tcg/arm/tcg-target.h
parent80fe30ed3432d1ba166f4583b297f1b51be58cc8 (diff)
downloadqemu-3233f0d463d299be89e2672928fc215dc99c2c71.zip
qemu-3233f0d463d299be89e2672928fc215dc99c2c71.tar.gz
qemu-3233f0d463d299be89e2672928fc215dc99c2c71.tar.bz2
Use libgcc __clear_cache to clean icache, when available.
Calling the clear cache syscall directly generates an illegal instruction on some (armv4) kernels. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5843 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/arm/tcg-target.h')
-rw-r--r--tcg/arm/tcg-target.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 6c180af..d0b11e8 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -69,8 +69,13 @@ enum {
static inline void flush_icache_range(unsigned long start, unsigned long stop)
{
+#if QEMU_GNUC_PREREQ(4, 1)
+ void __clear_cache(char *beg, char *end);
+ __clear_cache((char *) start, (char *) stop);
+#else
register unsigned long _beg __asm ("a1") = start;
register unsigned long _end __asm ("a2") = stop;
register unsigned long _flg __asm ("a3") = 0;
__asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg));
+#endif
}