X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshot.h;h=d3fc7b80f9856e5c83a662ba1235c72a6f1b18f4;hb=130a35155171503883aaf18e57f8957ce63d06e8;hp=af0130f43f83333cba7cab0307ed16eb6caba82e;hpb=ebebe8c4d739b4facc4d4c294dfb90367eb43cc8;p=model-checker.git diff --git a/snapshot.h b/snapshot.h index af0130f..d3fc7b8 100644 --- a/snapshot.h +++ b/snapshot.h @@ -1,34 +1,20 @@ +/** @file snapshot.h + * @brief Snapshotting interface header file. + */ + #ifndef _SNAPSHOT_H #define _SNAPSHOT_H -#define PAGESIZE 4096 - -/* If USE_MPROTECT_SNAPSHOT=1, then snapshot by using mmap() and mprotect() - If USE_MPROTECT_SNAPSHOT=0, then snapshot by using fork() */ -#define USE_MPROTECT_SNAPSHOT 1 - -/* Size of signal stack */ -#define SIGSTACKSIZE 16384 - -typedef unsigned int snapshot_id; - -typedef void (*VoidFuncPtr)(); -void initSnapShotLibrary(unsigned int numbackingpages, - unsigned int numsnapshots, unsigned int nummemoryregions, - unsigned int numheappages, VoidFuncPtr entryPoint); -void addMemoryRegionToSnapShot( void * ptr, unsigned int numPages ); +#include "snapshot-interface.h" +#include "config.h" +#include "mymemory.h" -snapshot_id takeSnapshot( ); +void snapshot_add_memory_region(void *ptr, unsigned int numPages); +snapshot_id take_snapshot(); +void snapshot_roll_back(snapshot_id theSnapShot); -void rollBack( snapshot_id theSnapShot ); - -void finalize(); - -#ifdef __cplusplus -extern "C" { -#endif -void createSharedLibrary(); -#ifdef __cplusplus -}; /* end of extern "C" */ +#if !USE_MPROTECT_SNAPSHOT +mspace create_shared_mspace(); #endif + #endif