}
/**
- * Record an access of type access_type at addresses a .. a + size - 1 in
+ * Record an access of type access_type at addresses a1 .. a2 - 1 in
* bitmap bm.
*/
void bm_access_range(struct bitmap* const bm,
- const Addr a,
- const SizeT size,
+ const Addr a1, const Addr a2,
const BmAccessTypeT access_type)
{
tl_assert(bm);
- tl_assert(size > 0);
+ tl_assert(a1 < a2);
- if (size == 4)
- bm_access_4(bm, a, access_type);
- else if (size == 1)
- bm_access_1(bm, a, access_type);
+ if (a2 - a1 == 4)
+ bm_access_4(bm, a1, access_type);
+ else if (a2 - a1 == 1)
+ bm_access_1(bm, a1, access_type);
else
{
Addr b;
- for (b = a; b != a + size; b++)
+ for (b = a1; b != a2; b++)
{
bm_access_1(bm, b, access_type);
}
for (i = 0; i < sizeof(s_args)/sizeof(s_args[0]); i++)
{
- bm_access_range(bm, s_args[i].address,
- s_args[i].size, s_args[i].access_type);
+ bm_access_range(bm,
+ s_args[i].address,
+ s_args[i].address + s_args[i].size,
+ s_args[i].access_type);
}
VG_(printf)("Map contents -- should contain 10 addresses:\n");
}
#endif
sg = thread_get_segment(thread_get_running_tid());
- bm_access_range(sg->bm, addr, size, eLoad);
+ bm_access_range(sg->bm, addr, addr + size, eLoad);
if (bm_has_conflict_with(thread_get_danger_set(), addr, addr + size, eLoad)
&& ! drd_is_suppressed(addr, addr + size))
{
}
#endif
sg = thread_get_segment(thread_get_running_tid());
- bm_access_range(sg->bm, addr, size, eStore);
+ bm_access_range(sg->bm, addr, addr + size, eStore);
if (bm_has_conflict_with(thread_get_danger_set(), addr, addr + size, eStore)
&& ! drd_is_suppressed(addr, addr + size))
{
tl_assert(a1 < a2);
tl_assert(! drd_is_any_suppressed(a1, a2));
- bm_access_range(s_suppressed, a1, a2 - a1, eStore);
+ bm_access_range(s_suppressed, a1, a2, eStore);
}
void drd_finish_suppression(const Addr a1, const Addr a2)
struct bitmap* bm_new(void);
void bm_delete(struct bitmap* const bm);
void bm_access_range(struct bitmap* const bm,
- const Addr address,
- const SizeT size,
+ const Addr a1, const Addr a2,
const BmAccessTypeT access_type);
void bm_access_4(struct bitmap* const bm,
const Addr address,
void bm_print(const struct bitmap* bm);
ULong bm_get_bitmap_creation_count(void);
ULong bm_get_bitmap2_creation_count(void);
-void bm_test(void);
-
#endif /* __DRD_BITMAP_H */