X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshotimp.h;h=6efdbd9a4ac3799fbd628ec4e2a1eb5c1cc12f59;hb=421c3af5d7265b26a4c946a710f2acd986c5d78a;hp=0560203f1dc8e358312d9b3cfc30040e4a6fb225;hpb=f3f31f82a34dbd625942cbfe13528e91ff64ed4c;p=model-checker.git diff --git a/snapshotimp.h b/snapshotimp.h index 0560203..6efdbd9 100644 --- a/snapshotimp.h +++ b/snapshotimp.h @@ -9,38 +9,33 @@ #include "snapshot.h" -#define SHARED_MEMORY_DEFAULT (100 * ((size_t)1 << 20)) // 100mb for the shared memory -#define STACK_SIZE_DEFAULT (((size_t)1 << 20) * 20) // 20 mb out of the above 100 mb for my stack - #if USE_MPROTECT_SNAPSHOT //Each snapshotrecord lists the firstbackingpage that must be written to revert to that snapshot struct SnapShotRecord { unsigned int firstBackingPage; }; -//Backing store page struct -struct SnapShotPage { - char data[PAGESIZE]; -}; +/** @brief Backing store page */ +typedef unsigned char snapshot_page_t[PAGESIZE]; //List the base address of the corresponding page in the backing store so we know where to copy it to struct BackingPageRecord { - void * basePtrOfPage; + void *basePtrOfPage; }; //Stuct for each memory region struct MemoryRegion { - void * basePtr; //base of memory region + void *basePtr; //base of memory region int sizeInPages; //size of memory region in pages }; //Primary struct for snapshotting system.... struct SnapShot { - struct MemoryRegion * regionsToSnapShot; //This pointer references an array of memory regions to snapshot - struct SnapShotPage * backingStore; //This pointer references an array of snapshotpage's that form the backing store - void * backingStoreBasePtr; //This pointer references an array of snapshotpage's that form the backing store - struct BackingPageRecord * backingRecords; //This pointer references an array of backingpagerecord's (same number of elements as backingstore - struct SnapShotRecord * snapShots; //This pointer references the snapshot array + struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot + snapshot_page_t *backingStore; //This pointer references an array of snapshotpage's that form the backing store + void *backingStoreBasePtr; //This pointer references an array of snapshotpage's that form the backing store + struct BackingPageRecord *backingRecords; //This pointer references an array of backingpagerecord's (same number of elements as backingstore + struct SnapShotRecord *snapShots; //This pointer references the snapshot array unsigned int lastSnapShot; //Stores the next snapshot record we should use unsigned int lastBackingPage; //Stores the next backingpage we should use @@ -55,6 +50,9 @@ struct SnapShot { #include +#define SHARED_MEMORY_DEFAULT (100 * ((size_t)1 << 20)) // 100mb for the shared memory +#define STACK_SIZE_DEFAULT (((size_t)1 << 20) * 20) // 20 mb out of the above 100 mb for my stack + struct SnapShot { void *mSharedMemoryBase; void *mStackBase; @@ -66,6 +64,6 @@ struct SnapShot { #endif //Global reference to snapshot data structure -extern struct SnapShot * snapshotrecord; +extern struct SnapShot *snapshotrecord; #endif /* __SNAPSHOTIMP_H__ */