projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace some switch_to_master with switch_thread
[c11tester.git]
/
datarace.h
diff --git
a/datarace.h
b/datarace.h
index 7c84121541312758ff469ebdc3946df5fdebb333..f026556add051292ea4c57daaac4ad42255f1576 100644
(file)
--- a/
datarace.h
+++ b/
datarace.h
@@
-44,10
+44,15
@@
struct DataRace {
void initRaceDetector();
void raceCheckWrite(thread_id_t thread, void *location);
void initRaceDetector();
void raceCheckWrite(thread_id_t thread, void *location);
+void atomraceCheckWrite(thread_id_t thread, void *location);
void raceCheckRead(thread_id_t thread, const void *location);
void raceCheckRead(thread_id_t thread, const void *location);
+void atomraceCheckRead(thread_id_t thread, const void *location);
void recordWrite(thread_id_t thread, void *location);
void recordWrite(thread_id_t thread, void *location);
-
bool checkDataRaces(
);
+
void recordCalloc(void *location, size_t size
);
void assert_race(struct DataRace *race);
void assert_race(struct DataRace *race);
+bool hasNonAtomicStore(const void *location);
+void setAtomicStoreFlag(const void *location);
+void getStoreThreadAndClock(const void *address, thread_id_t * thread, modelclock_t * clock);
/**
* @brief A record of information for detecting data races
/**
* @brief A record of information for detecting data races
@@
-55,8
+60,8
@@
void assert_race(struct DataRace *race);
struct RaceRecord {
modelclock_t *readClock;
thread_id_t *thread;
struct RaceRecord {
modelclock_t *readClock;
thread_id_t *thread;
- int
capacity
;
- int
numReads
;
+ int
numReads : 31
;
+ int
isAtomic : 1
;
thread_id_t writeThread;
modelclock_t writeClock;
};
thread_id_t writeThread;
modelclock_t writeClock;
};
@@
-78,6
+83,9
@@
bool race_equals(struct DataRace *r1, struct DataRace *r2);
#define WRITEMASK READMASK
#define WRITEVECTOR(x) (((x)>>38)&WRITEMASK)
#define WRITEMASK READMASK
#define WRITEVECTOR(x) (((x)>>38)&WRITEMASK)
+#define ATOMICMASK (0x1ULL << 63)
+#define NONATOMICMASK ~(0x1ULL << 63)
+
/**
* The basic encoding idea is that (void *) either:
* -# points to a full record (RaceRecord) or
/**
* The basic encoding idea is that (void *) either:
* -# points to a full record (RaceRecord) or
@@
-88,6
+96,7
@@
bool race_equals(struct DataRace *r1, struct DataRace *r2);
* - next 25 bits are read clock vector
* - next 6 bits are write thread id
* - next 25 bits are write clock vector
* - next 25 bits are read clock vector
* - next 6 bits are write thread id
* - next 25 bits are write clock vector
+ * - highest bit is 1 if the write is from an atomic
*/
#define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 7) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<38))
*/
#define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 7) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<38))