From d3fc9d46d40c2fe813cb5e987585d7312c27427b Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 7 Jul 2008 17:43:56 +0000 Subject: [PATCH] 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(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 9955a8ee249..3c6e61d9872 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 44926e71b3a..3d6c725c150 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. */