/*
 * globals.c
 *
 */
#include <nand.h>
#include <tm.h>
#include <chunks.h>
#include <ngssd.h>

int fds[NUM_SIM_FILES];

char mainlog[20] = "log_draft0";

int maintid;
int tids[NAND_CHIP_COUNT];
uint32_t program[NAND_PAGE_COUNT];

uint32_t real_writes;
uint32_t real_reads;
uint32_t reclaim_reads;
uint32_t reclaim_writes;

uint32_t ch_real_writes;
uint32_t ch_real_reads;
uint32_t ch_tm_reclaim_reads;
uint32_t ch_reclaim_reads;
uint32_t ch_reclaim_writes;

req_t* nandbusDeferred;

chm_t chm;
tm_t tm;
ngssd_t ngssd;

#ifdef TESTING
#include <hint_data.h>
#include "evgeny/ssd.h"

hint_payload_t hints[CH_CHUNK_COUNT]; /*"hint backing store". simple array to store all hints*/
pthread_mutex_t send_hint_lock;

ssd_device_info_t ssd_info_s;
ssd_device_info_t *ssd_info = &ssd_info_s;
#endif

#ifdef PROFILING
uint32_t hint_accessed;
uint32_t read_accessed;
int nand_total_reads;
int nand_total_writes;
int nand_erases;
uint32_t chip_writes[NAND_CHIP_COUNT];

pthread_t       profiling_thread;
pthread_mutex_t profiling_lock;
#endif
