From 1c800dbdb5e15c6385c702e7e6e78199ef26b790 Mon Sep 17 00:00:00 2001 From: marcel Date: Mon, 7 Jul 2008 17:43:56 +0000 Subject: Add inline function ia64_fc_i() to abstract inline assembly. Use the new inline function in ia64_invalidate_icache(). While there, add proper synchronization so that we know the fc.i instructions have taken effect when we return. --- sys/ia64/ia64/machdep.c | 5 ++++- sys/ia64/include/ia64_cpu.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 9955a8e..3c6e61d 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1531,7 +1531,10 @@ ia64_invalidate_icache(vm_offset_t va, vm_offset_t sz) lim = va + sz; while (va < lim) { - __asm __volatile("fc.i %0" :: "r"(va)); + ia64_fc_i(va); va += 32; /* XXX */ } + + ia64_sync_i(); + ia64_srlz_i(); } diff --git a/sys/ia64/include/ia64_cpu.h b/sys/ia64/include/ia64_cpu.h index 44926e7..3d6c725 100644 --- a/sys/ia64/include/ia64_cpu.h +++ b/sys/ia64/include/ia64_cpu.h @@ -197,6 +197,12 @@ ia64_fc(u_int64_t va) __asm __volatile("fc %0" :: "r"(va)); } +static __inline void +ia64_fc_i(u_int64_t va) +{ + __asm __volatile("fc.i %0" :: "r"(va)); +} + /* * Sync instruction stream. */ -- cgit v1.1