1 #define __STDC_FORMAT_MACROS
8 #include "threads-model.h"
9 #include "snapshot-interface.h"
12 * Helper functions used by CDSPass
13 * The CDSPass implementation does not replace normal load/stores with cds load/stores,
14 * but inserts cds load/stores to check dataraces. Thus, the cds load/stores do not
18 void cds_store8(void *addr)
20 //DEBUG("addr = %p, val = %" PRIu8 "\n", addr, val);
23 thread_id_t tid = thread_current_id();
24 raceCheckWrite8(tid, addr);
27 void cds_store16(void *addr)
29 //DEBUG("addr = %p, val = %" PRIu16 "\n", addr, val);
32 thread_id_t tid = thread_current_id();
33 raceCheckWrite16(tid, addr);
36 void cds_store32(void *addr)
38 //DEBUG("addr = %p, val = %" PRIu32 "\n", addr, val);
41 thread_id_t tid = thread_current_id();
42 raceCheckWrite32(tid, addr);
45 void cds_store64(void *addr)
47 //DEBUG("addr = %p, val = %" PRIu64 "\n", addr, val);
50 thread_id_t tid = thread_current_id();
51 raceCheckWrite64(tid, addr);
54 void cds_load8(const void *addr) {
55 DEBUG("addr = %p\n", addr);
58 thread_id_t tid = thread_current_id();
59 raceCheckRead8(tid, addr);
62 void cds_load16(const void *addr) {
63 DEBUG("addr = %p\n", addr);
66 thread_id_t tid = thread_current_id();
67 raceCheckRead16(tid, addr);
70 void cds_load32(const void *addr) {
71 DEBUG("addr = %p\n", addr);
74 thread_id_t tid = thread_current_id();
75 raceCheckRead32(tid, addr);
78 void cds_load64(const void *addr) {
79 DEBUG("addr = %p\n", addr);
82 thread_id_t tid = thread_current_id();
83 raceCheckRead64(tid, addr);