86 void NVM_PrintStats();
100 #define NVM_BEGIN_DURABLE() nvm_begin_durable() 101 #define NVM_END_DURABLE() nvm_end_durable() 103 #define NVM_CLFLUSH(p) nvm_clflush((char*)(void*)(p)) 105 #ifndef DISABLE_FLUSHES 106 #define NVM_FLUSH(p) \ 112 #define NVM_FLUSH_COND(p) \ 113 { if (NVM_IsInOpenPR(p, 1)) { \ 120 #define NVM_FLUSH_ACQ(p) \ 125 #define NVM_FLUSH_ACQ_COND(p) \ 126 { if (NVM_IsInOpenPR(p, 1)) { \ 132 #define NVM_PSYNC(p1,s) nvm_psync(p1,s) 134 #define NVM_PSYNC_COND(p1,s) \ 135 { if (NVM_IsInOpenPR(p1, s)) nvm_psync(p1,s); } 137 #define NVM_PSYNC_ACQ(p1,s) \ 139 nvm_psync_acq(p1,s); \ 142 #define NVM_PSYNC_ACQ_COND(p1,s) \ 144 if (NVM_IsInOpenPR(p1, s)) nvm_psync_acq(p1, s); \ 149 #define NVM_FLUSH_COND(p) 150 #define NVM_FLUSH_ACQ(p) 151 #define NVM_FLUSH_ACQ_COND(p) 152 #define NVM_PSYNC(p1,s) 153 #define NVM_PSYNC_COND(p1,s) 154 #define NVM_PSYNC_ACQ(p1,s) 155 #define NVM_PSYNC_ACQ_COND(p1,s) 158 static __inline
void nvm_clflush(
const void *p)
160 #ifndef DISABLE_FLUSHES 164 __asm__ __volatile__ (
165 "clflush %0 \n" :
"+m" (*(
char*)(p))
171 static __inline
void full_fence() {
172 __asm__ __volatile__ (
"mfence" :::
"memory");
void nvm_begin_durable()
Definition: log_mgr_api.cpp:72
void NVM_Initialize()
Definition: log_mgr_api.cpp:26
int NVM_IsInOpenPR(void *addr, size_t sz)
Definition: pregion_mgr_api.cpp:90
__thread uint64_t num_flushes
Definition: stats.cpp:27
void nvm_psync(void *addr, size_t sz)
Definition: log_mgr_api.cpp:154
void nvm_psync_acq(void *addr, size_t sz)
Definition: log_mgr_api.cpp:162
void nvm_end_durable()
Definition: log_mgr_api.cpp:78
void NVM_Finalize()
Definition: log_mgr_api.cpp:36