SHD-CacheAttackLab/Part2-FlushReload/util.h

32 lines
626 B
C
Raw Permalink Normal View History

2023-01-31 20:19:02 +00:00
// You may only use fgets() to pull input from stdin
// You may use any print function to stdout to print
// out chat messages
#include <stdio.h>
// You may use memory allocators and helper functions
// (e.g., rand()). You may not use system().
#include <stdlib.h>
#include <inttypes.h>
#include <time.h>
#include <stdbool.h>
#ifndef UTIL_H_
#define UTIL_H_
2024-02-07 14:23:56 +00:00
#define SEC_RANGE 1024
#define ALIGN 128
2023-01-31 20:19:02 +00:00
#define ADDR_PTR uint64_t
#define CYCLES uint32_t
CYCLES measure_one_block_access_time(ADDR_PTR addr);
void clflush(ADDR_PTR addr);
2024-02-07 14:23:56 +00:00
char *allocate_shared_buffer();
void deallocate_shared_buffer(char *buf);
2023-01-31 20:19:02 +00:00
#endif