x64: implement seL4_BenchmarkFlushCaches

by moving the ia32 implementation up a level to x86
and implementing the syscall stub.
This commit is contained in:
Anna Lyons 2017-04-11 13:57:47 +10:00
parent 37fef55a27
commit 8c02bc1301
3 changed files with 19 additions and 12 deletions

View file

@ -82,18 +82,6 @@ static inline void invalidateLocalTranslationAll(void)
invalidateLocalPageStructureCache();
}
/* Flushes entire CPU Cache */
static inline void ia32_wbinvd(void)
{
asm volatile("wbinvd" ::: "memory");
}
static inline void
arch_clean_invalidate_caches(void)
{
ia32_wbinvd();
}
static inline rdmsr_safe_result_t x86_rdmsr_safe(const uint32_t reg)
{
uint32_t low;

View file

@ -97,4 +97,16 @@ void flushCacheRange(void* vaddr, uint32_t size_bits);
/* Disables a variety of prefetchers */
bool_t disablePrefetchers(void);
/* Flushes entire CPU Cache */
static inline void x86_wbinvd(void)
{
asm volatile("wbinvd" ::: "memory");
}
static inline void
arch_clean_invalidate_caches(void)
{
x86_wbinvd();
}
#endif

View file

@ -454,6 +454,13 @@ seL4_BenchmarkNullSyscall(void)
asm volatile("" ::: "memory");
}
LIBSEL4_INLINE_FUNC void
seL4_BenchmarkFlushCaches(void)
{
x64_sys_null(seL4_SysBenchmarkFlushCaches);
asm volatile("" ::: "memory");
}
#ifdef CONFIG_BENCHMARK_TRACK_UTILISATION
LIBSEL4_INLINE_FUNC void
seL4_BenchmarkGetThreadUtilisation(seL4_Word tcb_cptr)