Code for accurate timing and cache maintenance.
Header file for cache maintenance.
cache_ctx_t cache_remove_prepare(void* addr): Prepares a context that can be used withcache_removeto remove the cache line containingaddrfrom the cache.void cache_remove(cache_ctx_t ctx): Removes the cache line associated withctxfrom the cache.
implemented by:
CACHE == EVICTION:eviction.cCACHE == FLUSHING:flushing.c
Header file for memory barrier and memory access.
void memory_fence(): A full memory barrier (DMB SY + ISB SY).void memory_access(void* addr): A memory access primitive.
Header file for timing.
timer_read(time): Gets the current timer value. Usage:uint64_t time; timer_read(time);uint64_t probe(void* addr): Time a memory load. The load is shielded with memory fences.void timer_start(): Prepare the timer. This must be called beforetimer_readorprobevoid timer_stop(): Stop the timer.
implemented by:
TIMER == COUNTER_THREAD:counter_thread.cTIMER == MSR:msr.c